📄 install.php
字号:
<?php/////////////////////////////// COPYRIGHT NOTICE /////////////////////////////////// This script is part of BosClassifieds, a software application by BosDev, Inc //// Use of any kind of part or all of this script or modification of this //// script requires a license from BosDev, Inc. Use or modification of //// this script without a license constitutes Software Piracy and will //// result in legal action from BosDev, Inc. All rights reserved. //// http://www.bosdev.com sales@bosdev.com //// //// BosClassifieds Copyright 2003, BosDev, Inc. //////////////////////////////////////////////////////////////////////////////////////Prep variablesif(PHP_VERSION < '4.1.0') { $_GET = &$HTTP_GET_VARS; $_POST = &$HTTP_POST_VARS; $_COOKIE = &$HTTP_COOKIE_VARS; $_SERVER = &$HTTP_SERVER_VARS; $_ENV = &$HTTP_ENV_VARS; $_FILES = &$HTTP_POST_FILES; $_REQUEST = array_merge($_GET, $_POST, $_COOKIE); }$isMagic = get_magic_quotes_gpc();$typesToRegister = array($_POST,$_GET,$_COOKIE);foreach($typesToRegister as $varType) { if(is_array($varType)) { while(list($key,$value) = @each($varType)) { if ($isMagic) { if(!is_array($value)) { $value = stripslashes($value); } } ${$key} = $value; } } }set_magic_quotes_runtime(0);//Find system infofunction getSysEnv($name) { global $_SERVER,$_ENV; $thisthing = ""; if (empty($_SERVER["$name"])) { $_SERVER["$name"]=""; } if (empty($_ENV["$name"])) { $_ENV["$name"]=""; } if(getenv($name) != '') { $thisthing = getenv("$name"); } if(($thisthing == '') && ($_SERVER["$name"] != '')) { $thisthing = $_SERVER["$name"]; } if(($thisthing == '') && ($_ENV["$name"] != '')) { $thisthing = $_ENV["$name"]; } return $thisthing; }//Find pathsfunction getPath($new_path="",$levels=0) { $fullpath = getSysEnv("PATH_TRANSLATED"); if (empty($fullpath)) { $fullpath = getSysEnv("SCRIPT_FILENAME"); } if(strstr($fullpath,"\\")) { if($new_path != "") { $new_path = str_replace("/","\\",$new_path); } $fullpath = str_replace("\\\\","\\",$fullpath); for($pathloop=0; $pathloop<=$levels; $pathloop++) { $fullpath = substr($fullpath,0,strrpos($fullpath,"\\")); } if($new_path != "") { $fullpath .= "$new_path\\"; } else { $fullpath = "$fullpath\\"; } } else { for($pathloop=0; $pathloop<=$levels; $pathloop++) { $fullpath = substr($fullpath,0,strrpos($fullpath,"/")); } if($new_path != "") { $fullpath .= "$new_path/"; } else { $fullpath = "$fullpath/"; } } return $fullpath; }//Find URLsfunction getUrl($new_url="",$levels=0) { $server = getSysEnv("SERVER_NAME"); $url = getSysEnv("PHP_SELF"); if(strtolower(getSysEnv('HTTPS') == "on")) { $protocol = "https://"; } else { $protocol = "http://"; } if(getSysEnv("SERVER_PORT") != "80") { $port = ":".getSysEnv("SERVER_PORT"); } for($pathloop=0; $pathloop<=$levels; $pathloop++) { $url = substr($url,0,strrpos($url,"/")); } if($new_url != "") { $url .= "$new_url"; } else { $url = "$url"; } return "{$protocol}{$server}{$port}{$url}/"; }echo<<<ENDPRINT<html> <head> <title>BosClassifieds v2.0 Installation</title> <meta HTTP-EQUIV="Pragma" CONTENT="no-cache"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <style> BODY { background-color:#FFFFFF; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px; margin-width:0px; margin-height:0px; padding:0px; padding-left:0px; padding-bottom:0px; padding-right:0px; padding-top:0px; } INPUT { background-color:#B7C7EF; font-family:Verdana,Tahoma,Arial; font-size:8pt; color:#000000; } SELECT { background-color:#B7C7EF; font-family:Verdana,Tahoma,Arial; font-size:8pt; color:#000000; } #generalBox table { font-family:Verdana,Tahoma,Arial; font-size:10pt; color:#000000; background-color:#FFFFFF; border:1px solid #000000; } #generalBox td { font-family:Verdana,Tahoma,Arial; font-size:10pt; color:#000000; background-color:#FFFFFF; } #generalBox .alttd { font-family:Verdana,Tahoma,Arial; font-size:10pt; color:#000000; background-color:#CFCFCF; } #generalBox .headtd { font-family:Verdana,Tahoma,Arial; font-size:10pt; font-weight:bold; color:#FFFFFF; background-color:#003399; } #generalBox INPUT { font-family:Verdana,Tahoma,Arial; font-size:10pt; color:#000000; background-color:#DDDDDD; } #generalBox SELECT { background-color:#DDDDDD; font-family:Verdana,Tahoma,Arial; font-size:8pt; color:#000000; } #generalBox a { font-family:Verdana,Tahoma,Arial; font-size:10pt; color:#000000; text-decoration:none; } #generalBox a:hover { font-family:Verdana,Tahoma,Arial; font-size:10pt; color:#FFB31A; text-decoration:underline; } #generalBox .error { color:#F00000; font-weight:bold; } #copyright { font-family:Verdana,Tahoma,Arial; font-size:7pt; color:#BBBBBB; } #copyright a { font-family:Verdana,Tahoma,Arial; font-size:7pt; color:#BBBBBB; text-decoration:none; } #copyright a:hover { font-family:Verdana,Tahoma,Arial; font-size:7pt; color:#FFB31A; text-decoration:underline; } </style> <body> <div id="generalBox" align="center"> <table width="100%" border="0" cellspacing="0" cellpadding="1"> <tr> <td class="headtd">BosClassifieds v2.0 Installation</td> </tr> </table> <br>ENDPRINT;switch($step) { case "1": $insUrl = getUrl(); $insPath = getPath(); echo<<<ENDPRINT <table width="600" border="0" cellspacing="1" cellpadding="3"> <form method="post" action="install.php"> <input type="hidden" name="step" value="2"> <tr> <td class="headtd">URL/Path</td> </tr> <tr> <td> In order to operate properly, the script needs to know exactly where it is located at on your server. The install script has made a guess as to where the script is located based upon information the server has told us. Please ensure this information is correct before proceeding.<br> <br> If you are unsure of this information, please check with your host.<br> <br> Please ensure you have entered a trailing slash, or backslash as needed.<br> <br> URL: <input type="text" name="insUrl" value="$insUrl" style="width:400px;"><br> PATH: <input type="text" name="insPath" value="$insPath" style="width:400px;"><br> <br> <input type="submit" value="Proceed"> </td> </tr> </form> </table>ENDPRINT; break; case "2": echo<<<ENDPRINT <table width="600" border="0" cellspacing="1" cellpadding="3"> <form method="post" action="install.php" onReset="javascript:history.go(-1);"> <input type="hidden" name="step" value="3"> <input type="hidden" name="insUrl" value="$insUrl"> <input type="hidden" name="insPath" value="$insPath"> <tr> <td class="headtd">Checking files</td> </tr> <tr> <td> The install script has checked to see if all of the required files are in the correct place. If any files are marked as missing, you will need ensure that they are in place and then try again. If the files appear to be in place, then you have entered the PATH incorrectly and will need to go back to enter the proper path.<br> <br>ENDPRINT; echo "<b>root directory</b>($insPath)<br>"; if(file_exists($insPath."account.php")) { echo "account.php - OK<br>"; } else { $errorFound = 1; echo "account.php is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."classified.php")) { echo "classified.php - OK<br>"; } else { $errorFound = 1; echo "classified.php is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."connect.php")) { echo "connect.php - OK<br>"; } else { $errorFound = 1; echo "connect.php is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."footer.php")) { echo "footer.php - OK<br>"; } else { $errorFound = 1; echo "footer.php is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."functions.php")) { echo "functions.php - OK<br>"; } else { $errorFound = 1; echo "functions.php is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."header.php")) { echo "header.php - OK<br>"; } else { $errorFound = 1; echo "header.php is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."index.htm")) { echo "index.htm - OK<br>"; } else { $errorFound = 1; echo "index.htm is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."index.php")) { echo "index.php - OK<br>"; } else { $errorFound = 1; echo "index.php is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."javascript.js")) { echo "javascript.js - OK<br>"; } else { $errorFound = 1; echo "javascript.js is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."panel.php")) { echo "panel.php - OK<br>"; } else { $errorFound = 1; echo "panel.php is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."payment.php")) { echo "payment.php - OK<br>"; } else { $errorFound = 1; echo "payment.php is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."recent.php")) { echo "recent.php - OK<br>"; } else { $errorFound = 1; echo "recent.php is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."search.php")) { echo "search.php - OK<br>"; } else { $errorFound = 1; echo "search.php is <b>MISSING!!!</b><br>"; } echo "<br><b>admin directory</b>({$insPath}admin)<br>"; if(file_exists($insPath."admin")) { echo "admin directory - OK<br>"; } else { $errorFound = 1; echo "admin directory is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."admin/index.php")) { echo "index.php - OK<br>"; } else { $errorFound = 1; echo "index.php is <b>MISSING!!!</b><br>"; } echo "<br><b>images directory</b>({$insPath}images)<br>"; if(file_exists($insPath."images")) { echo "images directory - OK<br>"; } else { $errorFound = 1; echo "images directory is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."images/listings")) { echo "images/listings directory - OK<br>"; } else { $errorFound = 1; echo "images/listings directory is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."images/banners")) { echo "images/banners directory - OK<br>"; } else { $errorFound = 1; echo "images/banners directory is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."images/categories")) { echo "images/categories directory - OK<br>"; } else { $errorFound = 1; echo "images/categories directory is <b>MISSING!!!</b><br>"; } echo "<br><b>integration directory</b>({$insPath}integration)<br>"; if(file_exists($insPath."integration")) { echo "integration directory - OK<br>"; } else { $errorFound = 1; echo "integration directory is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."integration/ipb.php")) { echo "ipb.php - OK<br>"; } else { $errorFound = 1; echo "ipb.php is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."integration/phpbb2.php")) { echo "phpbb2.php - OK<br>"; } else { $errorFound = 1; echo "phpbb2.php is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."integration/ubb.php")) { echo "ubb.php - OK<br>"; } else { $errorFound = 1; echo "ubb.php is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."integration/uus-intranet.php")) { echo "uus-intranet.php - OK<br>"; } else { $errorFound = 1; echo "uus-intranet.php is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."integration/uus.php")) { echo "uus.php - OK<br>"; } else { $errorFound = 1; echo "uus.php is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."integration/vb3.php")) { echo "vb3.php - OK<br>"; } else { $errorFound = 1; echo "vb3.php is <b>MISSING!!!</b><br>"; } echo "<br><b>languages directory</b>({$insPath}languages)<br>"; if(file_exists($insPath."languages")) { echo "languages directory - OK<br>"; } else { $errorFound = 1; echo "languages directory is <b>MISSING!!!</b><br>"; } echo "<br><b>payment directory</b>({$insPath}payment)<br>"; if(file_exists($insPath."payments")) { echo "payment directory - OK<br>"; } else { $errorFound = 1; echo "payment directory is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."payments/2checkout.php")) { echo "2checkout.php - OK<br>"; } else { $errorFound = 1; echo "2checkout.php is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."payments/authorizenet-sim.php")) { echo "authorizenet-sim.php - OK<br>"; } else { $errorFound = 1; echo "authorizenet-sim.php is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."payments/mail-in.php")) { echo "mail-in.php - OK<br>"; } else { $errorFound = 1; echo "mail-in.php is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."payments/paypal.php")) { echo "paypal.php - OK<br>"; } else { $errorFound = 1; echo "paypal.php is <b>MISSING!!!</b><br>"; } echo "<br><b>rss directory</b>({$insPath}rss)<br>"; if(file_exists($insPath."rss")) { echo "rss directory - OK<br>"; } else { $errorFound = 1; echo "rss directory is <b>MISSING!!!</b><br>"; } echo "<br><b>styles directory</b>({$insPath}styles)<br>"; if(file_exists($insPath."styles")) { echo "styles directory - OK<br>"; } else { $errorFound = 1; echo "styles directory is <b>MISSING!!!</b><br>"; } if(file_exists($insPath."styles/style.css")) { echo "style.css - OK<br>"; } else { $errorFound = 1; echo "style.css is <b>MISSING!!!</b><br>"; } if($errorFound == 1) { $button = "<input type=\"reset\" value=\"Go back and check path\">"; } else { $button = "<input type=\"submit\" value=\"Proceed\">"; } echo<<<ENDPRINT <br> $button </td> </tr> </form> </table>ENDPRINT; break;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -