nonshatter 26 Posting Whiz

Do you have

<?php session_start(); ?>

at the top of your pages?

nonshatter 26 Posting Whiz

Why do you want the user to enter the user id? Shouldn't this be handled by an auto increment field in your database?

This is roughly how I would validate it...

<?php
function VerifyForm(&$values, &wrong)  {

    if (strlen($values['userid']) == 0) {
		$wrong['userid'] = 'Enter your user id';   	
    }	
    return (count($wrong) == 0);
}
?>

<html>
<head></head>
<body>

<?php
	if (count($wrong) > 0) {
        	echo "There were some errors in your form...";     
   	}  
?>
<form action="#" method="post">
<table><tr>
	<td>User id:</td>
	<td><input type="text" name="userid"  <?php echo htmlentities($values['userid']) ?>></td>
	<td class="wrong"><?php echo $wrong['userid'] ?></td>
</tr></table>
</form>
</body>
</html>
jokomamamita commented: Thanks for your tips ~ jokomamamita +0