|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/abtechsci/mmc15/Membership/ |
Upload File : |
<?php
if($_POST['Submit'] != NULL){
$info = '<?php
function connect(){
$DB_USER = "'.$_POST['username'].'";
$DB_PASSWORD = "'.$_POST['password'].'";
$DB_HOST = "'.$_POST['hostname'].'";
$dbc = mysql_connect ($DB_HOST, $DB_USER, $DB_PASSWORD) or $error = mysql_error();
mysql_select_db("'.$_POST['dataname'].'") or $error = mysql_error();
mysql_query("SET NAMES `utf8`") or $error = mysql_error();
if($error){echo "<!-- $error -->";}}
function disconnect_data(){
@mysql_close($dbc);
@mysql_close();
}
?>';
$f = fopen('headers/database.php','w') or die('Unable to open headers/database.php for editing, please update it with database information manually, then upload extras/database.sql to the database.');
fwrite($f,$info);
fclose($f);
include('headers/database.php');
connect();
$f = fopen('extras/database.sql','r');
while($t = fread($f,1024657)){ $sql .= $t;}
fclose($f);
$lines = explode(';',$sql);
foreach($lines as $line){
if(trim($line)){
mysql_query($line) or die(mysql_error());
}
}
disconnect_data();
die('Installation Went Smoothly. Please remove install.php file. Default Admin Username: admin | Admin Password: admin2008');
}
?>
<p>Membership V2.0 By www.AwesomePHP.com:</p>
<p>To start installation, all we need to do is edit a file <strong>headers/database.php</strong> [<a href="http://free-php.net/?CHMOD">CHMODED</a> 700] and insert it database information (as well as putting in default tables/test data).</p>
<form name="isntall" id="install" method="post" action="install.php" style="display:inline;">
<table width="100%" border="1" cellspacing="0" cellpadding="5">
<tr>
<td width="50%">Database Host Name: [Usually "localhost" or Server IP] </td>
<td width="50%"><input name="hostname" type="text" id="hostname"></td>
</tr>
<tr>
<td width="50%">Database Name: </td>
<td width="50%"><input name="dataname" type="text" id="dataname"></td>
</tr>
<tr>
<td width="50%">Database User Name: </td>
<td width="50%"><input name="username" type="text" id="username"></td>
</tr>
<tr>
<td width="50%">Database User Password: </td>
<td width="50%"><input name="password" type="text" id="password"></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="Submit">
</div></td>
</tr>
</table>
</form>
<p><em><font color="#FF0000">If the above automatic installation doesn't work. Open headers/database.php and enter your database information, then query extras/database.sql into the database. </font></em></p>