区号查找脚本
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了区号查找脚本相关的知识,希望对你有一定的参考价值。
This simple script will return what state an areacode belongs to. Be sure to get the include file that contains the array here: http://snipplr.com/view/17340/area-code-lookup-script--include-file/
<?php // ****************************************************** // // areacode.php -- Areacode Lookup Script // // // // Author: Brad Arnold -- http://arnoldb.com // // // // Licensed under Creative Commons - Share Alike // // Licensed under GPL2 // // // // This simple script will take an inputted area code // // and return the state in which the area code belongs. // // // // This file must be named areacode.php and the file // // areacodes.inc.php must reside in the same directory // // unless changes to the code are made. // // ****************************************************** // } else { require("areacodes.inc.php"); } ?> <html> <head> <title>Area Code Lookup Utility</title> </head> <body> <!-- Begin Form --> <form action="areacode.php" method="get" onreset="doReset();"> Area Code: <input type="text" name="fareacode" maxlength="3" size="2"/> <input type="submit" /> <button onclick="form.reset();">Reset</button> </form> <!-- Begin code --> <?php // Put GET data into variable for ease of use $input = $_GET["fareacode"]; // Check the variable, if empty show instructions, if in-use show results if ($input) { // If input doesn't match an Area Code in the array return and error echo "Sorry," . " " . "<a style=font-weight:bold; />" . $input . "</a>" . " " . "is not a valid Area Code."; } else echo "Area code" . " " . "<a style=font-weight:bold; />" . $input . "</a>" . " " . "is found in the state of:" . " " . "<a style=font-weight:bold; />" . $areacode[$input] . "</a>"; } else echo "Enter a three (3) digit Area Code in the box above."; ?> </body> </html>
以上是关于区号查找脚本的主要内容,如果未能解决你的问题,请参考以下文章
npm : 无法加载文件 D:softcodeProcess ode ode_global pm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.micr +(代码片段