forumnz Posted December 31, 2006 Share Posted December 31, 2006 but i want to manually install it because it wont work on the server....What do i need to do?The code:[code]<html><body><?php/// check filesif (!file_exists("config.php")){die ("please ensure that config.php is uploaded to the same directory and try again<br />");};if (!file_exists("login.php")){die ("please ensure that login.php is uploaded to the same directory and try again<br />");};if (!file_exists("create.php")){die ("please ensure that create.php is uploaded to the same directory and try again<br />");};if (!file_exists("create.html")){echo ("please ensure that create.html is uploaded to the same directory or you are capable of create another form based input<br /><br />");};if (!file_exists("index.html")){echo ("please ensure that index.html is uploaded to the same directory or you are capable of creating another form based input<br /><br />");};if (!file_exists("require.php")){echo ("please ensure that require.php is uploaded to the same directory");};/// calls in the variables set in config.phprequire("config.php");/// connect to database$con=mysql_connect($mysql_hst,$mysql_us,$mysql_ps);if (!$con) { die('Could not connect: ' . mysql_error() . '<br /><br />Check your config file or contact your server support team.'); }; /// select DBif (!mysql_select_db($mysql_db, $con)){die ("Could not connect to the database you specified. Make sure it exists and is correctly named within config.php");};/// create table $create="CREATE TABLE IF NOT EXISTS members (id int NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), username VARCHAR(25), password VARCHAR(25), active int)";mysql_query($create);mkdir httpdocs('area', 0755);/// mark install as complete$file=fopen("install.txt","w");fwrite($file, "1");fclose($file);/// all is okecho ('Thank You - Successfully installed - If any errors have been reported then check your settings in config.php') ?></body></html>[/code]Thanks. Link to comment https://forums.phpfreaks.com/topic/32349-solved-this-is-an-install-code-i-have/ Share on other sites More sharing options...
trq Posted December 31, 2006 Share Posted December 31, 2006 Sorry, your question is pretty vague. What is it you want to do? Link to comment https://forums.phpfreaks.com/topic/32349-solved-this-is-an-install-code-i-have/#findComment-150210 Share on other sites More sharing options...
adaywalkr Posted December 31, 2006 Share Posted December 31, 2006 yea.. if this is what you mean:just import this in your existing database[code]CREATE TABLE IF NOT EXISTS members (id int NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), username VARCHAR(25), password VARCHAR(25), active int)[/code] Link to comment https://forums.phpfreaks.com/topic/32349-solved-this-is-an-install-code-i-have/#findComment-150211 Share on other sites More sharing options...
forumnz Posted December 31, 2006 Author Share Posted December 31, 2006 Near the bottom it also says that a install.txt file must be created... what does this mean and what is likely to go in it...I also have a file that runs properly if a certain code is in the install.txt file... how do I find out this code ( the part of the other file says - [code]/// check install$f = fopen("install.txt", "r");$fc = fgetc($f);fclose($f);if (!$fc == 1){die ("Message to Admin - Please install the script as described in the readme file<br /><br />Message to user - Sorry please try another time once the system has been set up correctly. Thanks. ");};[/code] - thanks) Link to comment https://forums.phpfreaks.com/topic/32349-solved-this-is-an-install-code-i-have/#findComment-150212 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.