Well when it goes to process it fails in the isset.
Register.php
<?php
include("header.inc");
?>
<form method="POST" action="process.php">
<div align="center">
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="154" style="border-width: 1px; border-style:solid; border-color:#000000"><div align="right">Username:</div></td>
<td width="146" style="border-width: 1px; border-style:solid; border-color:#000000"><input type="text" name="username" /></td>
</tr>
<tr>
<td style="border-width: 1px; border-style:solid; border-color:#000000"><div align="right">Password:</div></td>
<td style="border-width: 1px; border-style:solid; border-color:#000000"><input type="text" name="password" /></td>
</tr>
<tr>
<td style="border-width: 1px; border-style:solid; border-color:#000000"><div align="right">Email:</div></td>
<td style="border-width: 1px; border-style:solid; border-color:#000000"><input type="text" name="email" /></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="hidden" name"register" value="1">
<input type="submit" name="Submit" value="Submit" />
<input type="reset" name="reset" value="Reset" />
</div></td>
</tr>
</table>
</div>
</form>
<?php
include("footer.inc");
?>
Process.php
<?php
require("include/constants.php");
class Process
{
function Process(){
if(isset($_POST['register'])) {
$this->register();
}
else {
header("Location: main.php");
}
}
function register(){
$username = $_POST["username"];
$password = $_POST["password"];
$email = $_POST["email"];
$query = "INSERT INTO members (ID, username, password, email) VALUES (NULL, '$username', '$password', '$email')";
mysql_query($query, @mysql_connect(DB_SERVER, DB_USER, DB_PASS)) or die(mysql_error());
echo("<center><font size='4'><font color='red'>Post has been submitted! Will redirect in 2 seconds</center></font>");
echo("<META HTTP-EQUIV='refresh' CONTENT='2;news.php'>");
}
};
$process = new Process;
?>
When it submits it goes to Main.php instead of going to news.php like i wanted it to.
Edited by Whitey, 03 June 2008 - 12:15 PM.


Sign In
Create Account


Back to top









