Notice: Undefined index: do in C:\wamp\www\forum\register.php on line 30
This is for a user registration form, I am not sure what the problem is; please correct any errors you see and explain what I did wrong, as I am new trying to learn.
<?php
require_once( "functions.php" );
getHeader("Register");
connect();
if( !isset( $_GET['do'] ) )
{
?>
<center><table border="0" cellspacing="3" cellpadding="3"><br />
<form method="post" action="register.php?do=process"><br />
<tr><td colspan="2" align="center"><b>Registration Form</b></td></tr><br />
<tr><td><b>Username:</b></td><td><input type="text" name="username"></td></tr><br />
<tr><td><b>Password:</b></td><td><input type="password" name="password"></td></tr><br />
<tr><td><b>Confirm:</b></td><td><input type="password" name="passconf"></td></tr><br />
<tr><td><b>E-Mail:</b></td><td><input type="text" name="email"></td></tr><br />
<tr><td><b>Name:</b></td><td><input type="text" name="name"></td></tr><br />
<tr><td><b>AIM Address*:</b></td><td><input type="text" name="aim"></td></tr><br />
<tr><td colspan="2" align="center"><input type="submit" name="submit" value="Register"></td></tr><br />
</form></table></center><br />
<body>
<center><b>*</b> - <i>AIM address not required,</i> Type: None</center>
</body>
<?php
}
if( $_GET['do'] == 'process' )
{
$username = protect($_POST['username']);
$password = protect($_POST['password']);
$confirm = protect($_POST['passconf']);
$email = protect($_POST['email']);
$name = protect($_POST['name']);
$aim = protect($_POST['aim']);
include_once "reg_error.php";
//$sql4 = "INSERT INTO users ( username, password, email, name, aim, admin, time )
//VALUES ( '" . $username . "',' " . md5($password) . "', '" . $email . "', '" . $name . "', '" . $aim . "', '0', '" . time() . "' )";
//$res4 = mysql_query($sql4) or die(mysql_error());
//echo "You have successfully registered with the username <b>".$username."</b> and the password you provided!";
}
getFooter();
?>