Jump to content

[SOLVED] This is an install code i have...


forumnz

Recommended Posts

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 files
if (!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.php
require("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 DB
if (!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 ok
echo ('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

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)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.