Thankx lots for the previous solution! :D erm... for the following, i can mark out the required field but i can't get the infomation into my database [color=blue]<?php require_once('Connections/pd1.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Register</title> <style type="text/css"> .error {color:red; font-weight: bold;} </style> </head> <body> <?php $page = "register.php"; function print_form() { global $page, $error, $print_again, $HTTP_POST_VARS; $fields = array("first" => "text", "last" => "text", "age" => "text", "email_required" => "text", "login_required" => "text", "password1_required" => "password", "password2_required" => "password"); $labels = array("first" => "First_name", "last" => "Last_name", "age" => "Age", "email_required" => "Email", "login_required" => "*Desired_username", "password1_required" => "*Password", "password2_required" => "*Confirm password"); ?> <form name="form1" action="<?php echo $editFormAction; ?>" method="POST"> <? if($print_again) { ?><h3>You missed some fields. Please correct the <span class=error>red</span> fields. Passwords must match. <? } else { ?><h3>Please fill in the following fields.</h3><? } ?> <table border="0"> <? foreach($fields as $key => $value) { ?> <tr><td <? error_flag($error, $key); ?><?=$labels[$key]?>: </td> <td><input type="<?=$value?>" name="<?=$key?>" value="<? @print($HTTP_POST_VARS[$key])?>"></td></tr> <? } ?> <tr><td colspan="2" align="center"> <input type="submit" name="submit" value="Submit"></td></tr> </table> <input type="hidden" name="MM_insert" value="form1"> </form> <? }//end function print_form function error_flag($error, $field) { if($error[$field]) { print("<td class=error>"); } else { print("<td>"); } }//end function error_flag function check_form() { global $error, $print_again, $HTTP_POST_VARS; $print_again = false; //check required fields have been entered foreach($HTTP_POST_VARS as $key => $value) { if(($value == "") && eregi("_required$", $key)) { $error[$key] = true; $print_again = true; } else { $error[$key] = false; } } //verify email if (!eregi("^[a-z0-9]+[a-z0-9_-]*(\.[a-z0-9_-]+)*@[a-z0-9_-]+(\.[a-z0-9_-]+)*\.([a-z]+){2,}$", $HTTP_POST_VARS['email_required'])) { $error['email_required'] = true; $print_again = true; $HTTP_POST_VARS['email_required'] = "ENTER A VALID EMAIL"; } //verify desired user name is available $available = true; if (!$available) { $error['login_required'] = true; $print_again = true; $HTTP_POST_VARS['login_required'] = "Name Not Available: " . $HTTP_POST_VARS[ 'login_required']; } //verify password matched if ($HTTP_POST_VARS['password1_required'] != $HTTP_POST_VARS['password2_required']) { $error['password1_required'] = true; $error['password2_required'] = true; $HTTP_POST_VARS['password1_required'] = NULL; $HTTP_POST_VARS['password2_required'] = NULL; $print_again = true; } //print again if there are errors found if($print_again) { print_form(); } else { print("<h3>Thank you for completing the form!</h3>"); //do database insert, email, etc. Since data is OK! } }//end function check_form /***** MAIN *****/ if(isset($submit)) { check_form(); } else { print_form(); } ?> </body> </html>[/color] are u able to help?