以下为引用的内容: // choose a user name and password between the " " symbol //=========================== $admin_user_name="admin"; // your admin username $admin_password="pass"; // your password $site_com="webjx.com"; // your website name WITHOUT http:// and www $login="你已经登陆"; // succesful message when user are logged in ( NOT NECESSARY ) //=========================== // DO NOT EDIT NOTHING BELOW! if ((!isset($PHP_AUTH_USER)) || (!isset($PHP_AUTH_PW))) { /* No values: send headers causing dialog box to appear */ header('WWW-Authenticate: Basic realm="$site_com"'); header('HTTP/1.0 401 Unauthorized'); echo '<h1>访问的页面被限制.</h1>请检查你的用户名或密码是否正确,正常登陆本站才能查看 本站的内容'; exit; } else if ((isset($PHP_AUTH_USER)) && (isset($PHP_AUTH_PW))){ /* Values contain some values, so check to see if they're correct */ if (($PHP_AUTH_USER != "$admin_user_name") || ($PHP_AUTH_PW != "$admin_password")) { /* If either the username entered is incorrect, or the password entered is incorrect, send the headers causing dialog box to appear */ header('WWW-Authenticate: Basic realm="$site_com"'); header('HTTP/1.0 401 Unauthorized'); echo '<h1>访问的页面被限制.</h1>请检查你的用户名或密码是否正确,正常登陆本站才能查看 本站的内容'; exit; } else if (($PHP_AUTH_USER == "$admin_user_name") || ($PHP_AUTH_PW == "$admin_password")) { echo "$login "; } } ?> |
以下为引用的内容: <?php header("Refresh:0; url=http://webjx.com"); ?> |
以下为引用的内容: <? $customer[0] = 'phperz'; $customer[1] = 'web'; $customer[2] = 'mutou'; $customer[3] = 'chuxia'; $customer[4] = 'shenhua'; echo "第3个用户是: $customer[2]"; echo "所有的用户:"; $number = 5; $x = 0; while ($x < $number) { $customernumber = $x + 0; echo "Costumer Name $customernumber is $customer[$x] "; ++$x; } ?> |
以下为引用的内容: <? echo "3 of my customer are: $customer[0], " . " $customer[1] and " . " $customer[2]. " . ""; ?> |
以下为引用的内容: <? echo("There is "); $dir = "/path/to/the/folder/in/your/computer "; $count = 0; $handle=opendir($dir); while (($file = readdir($handle))!== false){ if ($file != "." && $file != "..") { $count++; }} echo $count; echo(" Pages For You To Search In This Directory."); ?> |
以下为引用的内容: <?php echo date("F d Y"); ?> 显示更新日期: <?php echo "Last Modified: " . date ("m/d/y.", getlastmod());?> |
以下为引用的内容: <? echo str_repeat("-", 30); ?> |