PHP script problem

SpaceshipSpaceship
NamecheapNamecheap
SpaceshipSpaceship
Watch

dreaminginspiration

Account Closed
Impact
6
Im having a problem and i think the following script is the problem, When i click to submit this form it just blanks the form and it doesnt write to my mysql database. Does anyone know why?

PHP:
<html>
<title>Instant Split Commissions >> Installations >> </title>
<head>
<link href="../common/main.css" rel="stylesheet" type="text/css">
</head>

<h1><center>Instant Split Commissions Installation</center></h1>
<hr>


<?

if ($submit)
{

	while(list($key,$value)=@each($_POST))
	{
		$$key=$value;
	}

	// First create the config files.

	$bpath=$sitepath . "images/marketing/";
	$bdispath=$httppath . "images/marketing/";
	$rfile=$sitepath .".htaccess";
	$pt = "/{{(.*?)}}/e";

	$config  = "<? \n";
	$config .= "\$host = \"$host\";\n";
	$config .= "\$dbname = \"$dbname\";\n";
	$config .= "\$dbuser = \"$uname\";\n";
	$config .= "\$dbpass = \"$pass\";\n";
	$config .= "\$root_path = \"$sitepath\";\n";
	$path=$sitepath . "/templates/";
	$config .= "\$path = \"$path\";\n";
	$config .= "\$http_path  = \"$httppath\";\n";
	$config .= "\$http_prod_path  = \"$httppath\";\n";
	$config .= "\$bannerimg_upload_path  = \"$bpath\";\n";
	$config .= "\$bannerimg_display_path  = \"$bdispath\";\n";
	$config .= "\$mem_cookie  = \"member\";\n";
	$config .= "\$Ptn  = \"$pt\";\n";
	$config .= "\$htaccess_file  = \"$rfile\";\n";
	$config .= "?>";


	// Write the config file 

	$fp = fopen("../common/config.php","w");
	fputs($fp,$config);
	fclose($fp);


	// Create the tables

	include("createtables.php");

	



	echo ("<br><br><br><center><font class=\"tbtext\">Instant Split Commissions successfully installed. <a href=\"../admin/index.php\">Click here</a> to login as admin.");

	echo ("<br><br><br><center><font class=\"tbtext\">Please remove the install directory for safety purpose.");


}
else
{

?>

<form action="install1.php" method=post>
<br><br> 
<table border=0 width=70% align="center">
<tr>
<td class="tbtext" colspan="2" align="center"><b>Mysql Details</b><br></td>
</tr>

<tr>
<td class="tbtext" align="left">Hostname (normally localhost)</td>
<td class="tbtext" align="left"><input type=text name=host class="typeforms" value="localhost"></td>
</tr>

<tr>
<td class="tbtext" align="left">Database Name</td>
<td class="tbtext" align="left"><input type=text name=dbname class="typeforms"></td>
</tr>


<tr>
<td class="tbtext" align="left">Database UserName</td>
<td class="tbtext" align="left"><input type=text name=uname class="typeforms"></td>
</tr>


<tr>
<td class="tbtext" align="left">Database Password</td>
<td class="tbtext" align="left"><input type=text name=pass class="typeforms"></td>
</tr>

<tr>
<td class="tbtext" colspan="2" align="center"><br><b>Site Details</b><br></td>
</tr>

<tr>
<td class="tbtext" align="left">Site Physical Path</td>
<td class="tbtext" align="left"><input type=text name=sitepath size=40 class="typeforms"> (With trailing slash)
<br>
(/home/classy/public_html/)
</td>
</tr>


<tr>
<td class="tbtext" align="left">Site http Path</td>
<td class="tbtext" align="left"><input type=text name=httppath size=40 class="typeforms"> (With trailing slash)
<br>
(http://www.classy.com/)
</td>
</tr>


<tr>
<td class="tbtext" colspan="2" align="center"><br><b>Admin Details</b><br></td>
</tr>

<tr>
<td class="tbtext" align="left">Admin Login </td>
<td class="tbtext" align="left"><input type=text name=admin_login class="typeforms" value="admin"></td>
</tr>


<tr>
<td class="tbtext" align="left">Admin Password</td>
<td class="tbtext" align="left"><input type=text name=admin_pass class="typeforms"></td>
</tr>


<tr>
<td class="tbtext" align="left">Admin Email</td>
<td class="tbtext" align="left"><input type=text name=admin_email class="typeforms"></td>
</tr>


<tr>
<td colspan="2" align="center">
<br><br>
<input type=submit name=submit value="Finish" class="typeforms">
</td>
</tr>


</table>

<?

}



?>
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
if ($submit)

what is the value of $submit? if you're trying to see if there is a submission you have to do $submit = $_POST['submit'];

then you can do the if($submit)

good luck
 
0
Close
So i have to insert $submit = $_POST['submit']; infront of if($submit)
 
0
Close
yes if the name of the submit button is 'submit' as your code shows. let me know.
 
1
Close
THANK YOU! IT WORKED!

rep added and all my np i have sent.
 
1
Close
good to hear that :) rep added too.
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back