How come this is not working? (php/HTML question)?

dundass90

New member
I am working on a text MMO/MUD and on the registration form i have this.


<form method=post action=register.php?action=register>
<table>
<tr><td>Username:</td><td><input type=text name=user></td></tr>
<tr><td>Email:</td><td><input type=text name=email></td></tr>
<tr><td>Verify Email:</td><td><input type=text name=vemail></td></tr>
<?php
//print "<tr><td>Referral ID:</td><td><input type=text name=ref readonly value=ref> <i>If you don't know what this is, leave it blank.</i></td></tr>";
?>
<tr><td colspan=2 align=center><input type=submit value=register></td></tr>
</form>

<?php
if ($action == 'register') {
if (!$user || !$email || !$vemail ) {
print "You must fill out all fields.";
include("foot.php");
exit;
}

?>
When the form is submitted it tells me:


Notice: Undefined variable: action in C:\wamp\www\gamer\register.php on line 23

line 23 is the line that reads : If($action==register)

What am i doing wrong here?
 
Back
Top