Previous Thread
Next Thread
Print Thread
Hop To
#28031 06/26/2003 11:49 PM
Anonymous
Unregistered
Anonymous
Unregistered
Howdy,

Everthing looked like it was going okay and then step 7 is not what I expected. What I got was a page on my browser that had the following:

BODY,TABLE { color: #333333; font-family: verdana; font-size: 12px; font-weight: bold; } .HEADER { color: #CC9933; font-size: 14px; } UBB.threads Installation Wizard


Step $step
"; } // Print out the footer function basic_footer() { echo "
"; echo ""; } // ---------------------------------------------------------------------- // STEP 1 function step1() { $step = 1; $scriptname = find_environmental('PHP_SELF'); basic_header($step); echo " In order to automate the installation procedure, we first need to make sure all of the proper files have write access. If any of these checks fail you will need to change the permissions on these files. (Chmod 666 or 664 on linux and granting write access to the files/directories on Windows. Your stylesheets, images/icons and images/graemlins directories will probably need to be 777 so you can create new stylesheets, icons and graemlins from the admin section).
Note: The only files that are necessary at this point are main.inc.php, config.inc.php and theme.inc.php. If any of the non-critical files fail you can continue the installation and change the permissions on these once the program is installed.


Main Directory
main.inc.php "; $check = @fopen("main.inc.php","a"); if (!$check) { echo " FAILED "; $fail = 1; } else { echo " PASSED "; } echo "
config.inc.php "; $check = @fopen("config.inc.php","a"); if (!$check) { echo " FAILED "; $fail = 1; } else { echo " PASSED "; } echo "
theme.inc.php "; $check = @fopen("theme.inc.php","a"); if (!$check) { echo " FAILED "; $fail = 1; } else { echo " PASSED "; } echo "
filters/all "; $dir = opendir("filters"); while ($file = readdir($dir)) { if ($file == "." || $file == "..") { continue; } $check = @fopen("filters/$file","a"); if (!$check) { break; } } if ( (!$check) && ($file) ){ echo " FAILED ($file: non-critical) "; $nocrit = 1; } else { echo " PASSED "; } echo "
includes/.php files "; $dir = opendir("includes"); while ($file = readdir($dir)) { $check = ""; if (!ereg(".php",$file) ) { continue; } $check = @fopen("includes/$file","a"); if (!$check) { break; } } if ( (!$check) && ($file) ) { echo " FAILED ($file: non-critical) "; $nocrit = 1; } else { echo " PASSED "; } echo "
stylesheets/all "; $dir = opendir("stylesheets"); while ($file = readdir($dir)) { if ($file == "." || $file == "..") { continue; } $check = @fopen("stylesheets/$file","a"); if (!$check) { break; } } if ( (!$check) && ($file) ) { echo " FAILED ($file: non-critical) "; $nocrit = 1; } else { echo " PASSED "; } echo "
images/icons/all "; $dir = opendir("images/icons"); while ($file = readdir($dir)) { if ($file == "." || $file == "..") { continue; } $check = @fopen("images/icons/$file","a"); if (!$check) { break; } } if ( (!$check) && ($file) ) { echo " FAILED ($file: non-critical) "; $nocrit = 1; } else { echo " PASSED "; } echo "
images/graemlins/all "; $dir = opendir("images/graemlins"); while ($file = readdir($dir)) { if ($file == "." || $file == "..") { continue; } $check = @fopen("images/graemlins/$file","a"); if (!$check) { break; } } if ( (!$check) && ($file) ) { echo " FAILED ($file: non-critical) "; $nocrit = 1; } else { echo " PASSED "; } echo "
"; if ($fail) { echo "One or more of the above files does not have write permissions. Please correct this and click the button below to try again.
"; } elseif ($nocrit) { echo "Some of the non-critical files do not have write permissions. You can try to correct these now and check again or you can worry about these later and continue with the installation. NOTE: Permissions will need to be changed on these files in order to use some of the admin functions.
"; } else { echo "All checks passed.
"; } echo "
"; basic_footer(); } // ------------------------------------------------------------------------- // STEP 2 function step2($step="",$dbserver,$dbname,$dbuser,$dbpass,$servererror,$nameerror,$usererror,$passerror,$tbprefix,$cookieprefix) { if (!$dbserver) { $dbserver = "localhost"; } basic_header($step); $scriptname = find_environmental('PHP_SELF'); echo " This next step consists of gathering the database information. You will need to know the server the mysql engine is running on, the database name, the username, and the password if necessary.
Database server $servererror
Database name $nameerror
Database user $usererror
Database password $passerror
Tablename prefix (no spaces)

"; basic_footer(); } // ---------------------------------------------------------------------- // STEP 3 function step3($step="",$dbserver="",$dbname="",$dbuser="",$dbpass="",$tbprefix="",$cookieprefix="") { $scriptname = find_environmental('PHP_SELF'); $tbprefix = str_replace(" ","",$tbprefix); if (!$tbprefix) { $tbprefix = "w3t_"; } basic_header($step); echo " Here we are checking your database connectivity and permissions. If any of these checks fail you will need to correct the errors in order to proceed.
Connecting to server "; $check = mysql_connect($dbserver,$dbuser,$dbpass); if (!$check) { echo "FAILED "; $servererror="?"; $usererror="?"; $passworderror="?"; $fail = 1; } else { echo "PASSED"; } echo "
Connecting to database "; if (!$fail) { $check2 = mysql_select_db($dbname,$check); } if ( ($fail) || (!$check2) ) { echo "FAILED "; $nameerror = "?"; $fail = 1; } else { echo "PASSED"; } if ($fail) { echo "
One or more of the above checks failed. Click the button below to return to the previous screen to verify your settings.
"; } else { echo "
Creating a table "; $query = "CREATE TABLE UBBT_TEST(TEST text)"; $sth = mysql_query($query,$check); if (!$sth) { echo "FAILED"; $nocreate=1; } else { echo "PASSED"; } echo "
Dropping a table "; $query = "DROP TABLE UBBT_TEST"; $sth = mysql_query($query,$check); if (!$sth) { echo "FAILED"; $nodrop=1; } else { echo "PASSED"; } if ( ($nocreate) || ($nodrop) ) { echo "
You do not have all of the necessary permissions to this database. You need to make sure that the supplied username/password combination gives you full control to the specified database.
You may run the tests again if you have cleared this problem up, or you may return to the previous screen to change your database variables.


"; } else { echo "

All test passed

"; } } echo "
"; basic_footer(); } // ---------------------------------------------------------------------- // STEP 4 function step4($step="",$dbserver="",$dbname="",$dbuser="",$dbpass="",$phpurl="",$images="",$styledir="",$path="",$imagepath="",$stylepath="",$referer="",$phpurlerror="",$imageserror="",$st yledirerror="",$patherror="",$imagepatherror="",$stylepatherror="",$referererror="",$tbprefix="",$cookieprefix="") { $scriptname = find_environmental('PHP_SELF'); basic_header($step); if (!$phpurl) { $What = find_environmental('REQUEST_URI'); $script['0'] = ""; preg_match("/(.*)\/(.*)\.php/",$What,$script); $url = $script['1']; $phpurl = $url; } if (!$images) { $images = "$url/images"; } if (!$path) { $path = find_environmental('SCRIPT_FILENAME'); $script['0'] = ""; preg_match("/(.*)\/(.*)\.php/",$path,$script); $path = $script['1']; } if (!$imagepath) { $imagepath = $path . "/images"; } if (!$styledir) { $styledir = "$url/stylesheets"; } if (!$stylepath) { $stylepath = $path . "/stylesheets"; } if (!$referer) { $referer = "http://" . find_environmental('HTTP_HOST'); } echo " Next we need to gather information on the paths and url of your installation. Some of these values are pre-filled but may not be correct depending on your system. Please change if necessary.

The domain UBB.threads will be run on
$referererror

Absolute URL to the UBB.threads install
$phpurlerror

Absolute URL to image directory
$imageserror

Absolute URL to stylesheets directory
$styledirerror

Path to your UBB.threads install
$patherror

Path to your images directory
$imagepatherror

Path to your stylesheets directory
$stylepatherror

Custom cookie prefix (Can be left blank. Useful if you have 2 installs and don't want cookies from one causing problems with the other)


"; echo " "; basic_footer(); } // ---------------------------------------------------------------------- // STEP 5 function step5($step="",$dbserver="",$dbname="",$dbuser="",$dbpass="",$phpurl="",$images="",$styledir="",$path="",$imagepath="",$stylepath="",$referer="",$tbprefix="",$cookieprefix="") { $scriptname = find_environmental('PHP_SELF'); basic_header($step); echo " Checking all path/url information. Please make sure you have all files uploaded, or you will get false reporing. NOTE: The first 3 might fail if PHP is unable to open files via a URL. If that is the case you may continue to the next step.

"; echo " phpurl ($referer{$phpurl}) "; $check = @fopen("$referer{$phpurl}/createtable.php","r"); if (!$check) { echo "UNABLE TO OPEN"; $nocrit=1; $phpurlerror="?"; } else { echo "PASSED"; } echo "
"; echo " images ($referer{$images}) "; $check = @fopen("$referer{$images}/flat.gif","r"); if (!$check) { echo "UNABLE TO OPEN"; $nocrit = 1; $imageserror="?"; } else { echo "PASSED"; } echo "
"; echo " styledir ($referer{$styledir}) "; $check = @fopen("$referer{$styledir}/infopop.css","r"); if (!$check) { echo "UNABLE TO OPEN"; $nocrit = 1; $styledirerror="?"; } else { echo "PASSED"; } echo "
"; echo " path ($path) "; $check = @fopen("$path/createtable.php","r"); if (!$check) { echo "FAILED"; $fail = 1; $patherror="?"; } else { echo "PASSED"; } echo "
"; echo " imagepath ($imagepath) "; $check = @fopen("$imagepath/flat.gif","r"); if (!$check) { echo "FAILED"; $fail = 1; $imagepatherror="?"; } else { echo "PASSED"; } echo "
"; echo " stylepath ($stylepath) "; $check = @fopen("$stylepath/infopop.css","r"); if (!$check) { echo "FAILED"; $fail = 1; $stylepatherror="?"; } else { echo "PASSED"; } echo "
"; if ( ($fail) || ($nocrit) ) { echo "
One or more of the above checks have failed. You might need to go back and verify your settings.
"; } else { echo "

All checks passed. "; } echo "
"; echo " "; basic_footer(); } // ---------------------------------------------------------------------- // STEP 6 function step6($step="",$dbserver="",$dbname="",$dbuser="",$dbpass="",$phpurl="",$images="",$styledir="",$path="",$imagepath="",$stylepath="",$referer="",$tbprefix="",$cookieprefix="") { global $thisversion; $scriptname = find_environmental('PHP_SELF'); $referer = preg_replace("/\/$/","",$referer); // ------------------------------------- // Let's print out the basic config file $newconfig = << EOF; // -------------------- // Write the new config $fd = fopen("config.inc.php","w"); fwrite($fd,$newconfig); fclose($fd); // ----------------------------------------------------------- // Now let's write the main.inc.php file with the proper path $mainfile = << EOF; $fd = fopen("main.inc.php","w"); fwrite($fd,$mainfile); fclose($fd); $step = 6; basic_header($step); echo " All config files have been created. You may now proceed to creating the database tables.
"; basic_footer(); } function find_environmental ($name) { global $HTTP_SERVER_VARS; $this = ""; // Regular way if(getenv($name) != '') { $this = getenv("$name"); } // end if // Irregular way if(($this == '') && ($HTTP_SERVER_VARS["$name"] != '')) { $this = $HTTP_SERVER_VARS["$name"]; } // end if // 4.1 way if(($this == '') && ($_ENV["$name"] != '')) { $this = $_ENV["$name"]; } // end if return $this; } // end func function get_input ($name="",$type="") { global $HTTP_POST_VARS, $HTTP_GET_VARS; global $_POST, $_GET, $_COOKIE, $_SESSION; $this = ""; if (isset($_GET["$name"])) { $this = $_GET["$name"]; return $this; } elseif (isset($HTTP_GET_VARS["$name"])) { $this = $HTTP_GET_VARS["$name"]; return $this; } if (isset($_POST["$name"])) { $this = $_POST["$name"]; return $this; } elseif (isset($HTTP_POST_VARS["$name"])) { $this = $HTTP_POST_VARS["$name"]; return $this; } } ?>

Is this right?

Thanks

#28032 06/27/2003 1:28 AM
Anonymous
Unregistered
Anonymous
Unregistered
If you're seeing php code like that in the browser - then PHP stopped running on the server.

If it's your server, you probably need to restart PHP - if not - I'd check with your host.

Josh
www.joshuapettit.com
ThreadsDev.com Administrator | InfoPop Community Moderator
Register to see my How To/Site Help Library Forum at ThreadsDev.com.
My threads 'tweaking' abilities are for hire for upgrades, tweaks and modifications.


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
PHP 8 bug in membermanage.tmpl
by phoenix011235 - 09/08/2026 7:47 PM
Are any of these legitmate?
by Baldeagle - 09/06/2026 1:37 PM
After server reboot
by Morgan - 09/02/2026 8:27 AM
Email Settings
by Outdoorking - 05/13/2026 2:44 AM
Who's Online Now
0 members (), 206 guests, and 158 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Ride safe!
Ride safe!
by Morgan, December 7
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260527)