submit on correctly entered captcha - php

I have the following page with an option box, when the user selects the following options and then clicks submit, it takes them to the relevant url. However the user must type the correct string in the box which matches a simple static captcha image which is on the screen.
Currently the code looks like this, however i need help setting the condition so that "abcdef" must be typed in the box before it is submitted otherwise giving an error.
<?php
// Check to see if the form has been submitted.
if(isset($_POST['menu1'])) {
// If the form has been submitted, force a re-direct to the choice selected.
header('Location: ' . $_POST['menu1']);
}
?>
<div style="padding-left: 50px">
<p class="arial"><strong></strong><br /><br /></p>
<form method="post">
<table class="freecontact2form" border="0" width="400px">
<tbody>
<tr>
<td colspan="2"><span style="font-size: x-small;"> </span> <font color=#000000 ></font>
<br /><br /></td>
</tr>
<tr>
<td valign="top"><table width="400px" class="freecontact2form">
<tr>
<td colspan="2"><br />
<br />
<div class="freecontact2formmessage"> </div></td>
</tr>
<tr>
<td valign="top"><label for="menu1" >These are the following options:<span class="required_star"> </span></label></td>
<td valign="top"><select name="menu1" id="menu1">
<option selected="selected" value ="http://www.google.com">Google </option>
<option value ="www.msn.com">MSN</option>
<option value ="www.youtube.com">Youtube</option>
<option value ="bing.com">Bing</option>
</select></td>
</tr>
<tr>
<td valign="top"><label for="captcha" ><span class="required_star"></span><span class="required_star"></span></label></td>
<td valign="top"><BR /><BR /><img src="captcha.jpg" /></td>
</tr>
<tr>
<td>Please enter the characters shown in the CAPTCHA image:</td>
<td><input type="text" name="captcha" id="captcha" value="" size="10" />
</td>
</tr>
<tr>
<td style="text-align:center" colspan="2"><br /><br />
<input type="submit" value=" Submit ">
</td>
</tr>
</table></td>
<td valign="top"> </td>
</tr>
<tr>
</tr>
<tr>
</tr>
</tbody>
</table>
</form> <br />
<p> </p>
<p> </p>

Save the code in a session when you first display the page. Then check the POST value of the code field against the session variable.
session_start();
$_SESSION['captcha'] = 'abcdef';
On form submission:
session_start();
if($_POST['captcha'] == $_SESSION['captcha'] && isset($_POST['menu1'])){
header();
}

Related

Preserve form values from page to page

I have two PHP pages from one I input the year and after submitting year value goes in next page via form input as in image enter image description here
image just after clicking the submit button of first page
code for the first page is
<div class="col-sm-12" style="background-color:lavender;">
<form method="post" action="next.php">
<table id="emi" width="100%">
<tr>
<td width="100%">
<div align="center"><b>
<h3> Enter Fiancial Information:</h3>
</b> </td>
<table width="100%" border="0" id="emi">
<tr>
<td><strong>First Calender Year of DATA! ( i.e. 1999 ) </strong></td>
<td><input type="text" class="form-control" placeholder="Enter the First Assesment Year" name="year" pattern="\d*" maxlength="4"></td>
<td><input type="submit" value="Go" name="submit"class="btn btn-success"></td>
</tr></table>
</table></form>
</table>
I have two PHP pages from one I input the year and after submitting year value goes in next page via form input as in image enter image description here
In next page I have one form input also and after input the values in next page and after clicking compute button the value of year which we call from page one disappear. As shown in image
Image after clicking the compute button on next.php
code for the next.php which is called after the first page is
<?php
error_reporting(0);
$year=$_REQUEST['year'];
$x=$year+1;
$y=$x+1;
?>
<table id="emi"width="100%">
<tr>
<td width="40%"><strong>INCOME STATEMENT
</strong></td>
<td width="20%"><strong> 31-03-<?php echo $year;?></strong></td>
<td width="20%"><strong> 31-03-<?php echo $x?></strong></td>
<td width="20%"><strong> 31-03-<?php echo $y?></strong></td>
</tr>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<div class="form-group">
<table id="emi" width="100%">
<tr>
<td width="40%"><strong>Sundray Creditors</strong></td>
<td width="20%"><input type="text" name="a1" size="8" class="form-control"></td>
<td width="20%"><input type="text" name="suncre" size="8" class="form-control"></td>
<td width="20%"><input type="text" name="inv" size="8" class="form-control"></td>
</tr>
<tr>
<td width="40%"><strong>Sundray Creditors</strong></td>
<td width="20%"><input type="text" name="a2" size="8" class="form-control"></td>
<td width="20%"><input type="text" name="suncre" size="8" class="form-control"></td>
<td width="20%"><input type="text" name="inv" size="8" class="form-control"></td>
</tr>
</table>
<table id="emi" width="100%">
<tr>
<td colspan="3">
<center>
<input type="submit" value="Compute" name="submit"class="btn btn-success"></center>
</td>
</tr>
</table>
</form>
<?php
error_reporting(0);
if($_SERVER['REQUEST_METHOD']=="POST"){
$a=$_POST['a1'];
$b=$_POST['a2'];
echo $a+$b;
}?>
I have only call the value of year then plus one in it as you see 2000 2001 2002 to next page and when I enter the value of sundry it disappears the value of year and we get only plus means value of year become 0 after clicking the compute button.
When you submit the form on the second page via your "Compute" button $_REQUEST['year'] is no longer set because it was from the previous request.
One way around this would be to add a hidden input field which stores the $_REQUEST['year'] value for the next request.
Something like this should work:
<input type="hidden" name="year" value="<? echo $_REQUEST['year']; ?>">
replace your next.php with this code
<?php
error_reporting(0);
$year=$_REQUEST['year'];
if($year==null){
$year=$_POST['year'];
}
$x=$year+1;
$y=$x+1;
?>
<table id="emi"width="100%">
<tr>
<td width="40%"><strong>INCOME STATEMENT
</strong></td>
<td width="20%"><strong> 31-03-<?php echo $year;?></strong></td>
<td width="20%"><strong> 31-03-<?php echo $x?></strong></td>
<td width="20%"><strong> 31-03-<?php echo $y?></strong></td>
</tr>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<div class="form-group">
<table id="emi" width="100%">
<tr>
<td width="40%"><strong>Sundray Creditors</strong></td>
<td width="20%"><input type="text" name="a1" size="8" class="form-control"></td>
<td width="20%"><input type="text" name="suncre" size="8" class="form-control"></td>
<td width="20%"><input type="text" name="inv" size="8" class="form-control"></td>
</tr>
<tr>
<td width="40%"><strong>Sundray Creditors</strong></td>
<td width="20%"><input type="text" name="a2" size="8" class="form-control"></td>
<td width="20%"><input type="text" name="suncre" size="8" class="form-control"></td>
<td width="20%"><input type="text" name="inv" size="8" class="form-control"></td>
</tr>
</table>
<table id="emi" width="100%">
<tr>
<td colspan="3">
<center>
<input type="hidden" id="year" name="year" value="<?php echo($year);?>">
<input type="submit" value="Compute" name="submit"class="btn btn-success"></center>
</td>
</tr>
</table>
</form>
<?php
error_reporting(0);
if($_SERVER['REQUEST_METHOD']=="POST"){
$a=$_POST['a1'];
$b=$_POST['a2'];
echo $a+$b;
}?>

Creating a CSV from a web form output

I'm currently trying to make a web form such that when a user enters their information (they're applying for a service upgrade), their application will be put through to a CSV file.
I've created my web form, albeit very roughly as I'm not skilled in web dev/design. This is it here:
<!DOCTYPE html>
<html>
<style type="text/css">
.fieldset-auto-width {
display:inline;
}
form {
text-align: center;
}
select.my_dropdown {
width:130px;
}
</style>
<head>
<!-- head stuff goes here -->
<script src="users.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js" ></script>
<script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js" ></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css" >
</head>
<body>
<h2 align="center"><u>Service Request Application Form</u></h2>
<hr>
<?php
if($_POST['formSubmit'] == "Submit Application")
{
$fn = $_POST['CustomerName'];
}
?>
<form method="post" align="center" name="myForm" id="applicationform" action="export.php">
<!--###################################### CONTACT INFORMATION FIELDSET ######################################-->
<fieldset style="border: 1px black solid">
<legend style="font-weight:bold"><u>Contact Information</u></legend>
<table>
<tr>
<th></th>
<th><u>Customer</u></th>
<th title="Electrician"><u>Consultant/Contractor</u></th>
</tr>
<tr>
<td>
<tr>
<td align="right" id="namelabel">Contact Name:</td>
<td><input type="text" id="customername" name="CustomerName" title="Name of contact on account"/></td>
<td><input type="text" id="contractorname" name="ContractorName" title="Name of contractor or consultant" /></td>
</tr>
<tr>
<td align="right" id="addresslabel">Mailing Address:</td>
<td><input type="text" id="customeraddress" name="CustomerMailingAddress" title="Enter your mailing address"/></td>
<td><input type="text" id="contractoraddress" name="ContractorMailingAddress" title="Enter your contractor's mailing address" /></td>
</tr>
<tr>
<td align="right" id="phonelabel">Phone Number:</td>
<td><input type="text" id="customerphone" name="CustomerPhoneNumber" title="Enter your phone number here" /></td>
<td><input type="text" id="contractorphone" name="ContractorPhoneNumber" title="Enter contractor's phone number here" /></td>
</tr>
<tr>
<td align="right" id="mobilephonelabel">Mobile Number:</td>
<td><input type="text" id="customermobilephone" name="CustomerMobilePhoneNumber" title="Enter your mobile phone number here"/></td>
<td><input type="text" id="contractormobilephone" name="ContractorMobilePhoneNumber" title="Enter contractor's mobile phone number here"/></td>
</tr>
<tr>
<td align="right" id="faxlabel">Fax:</td>
<td><input type="text" id="customerfax" name="CustomerFax" title="Enter fax information here" /></td>
<td><input type="text" id="contractorfax" name="ContractorFax" title="Enter fax information here"/></td>
</tr>
<tr>
<td align="right" id="emaillabel">E-mail:</td>
<td><input type="text" id="customeremail" name="CustomerEmail" title="Enter your email address here" /></td>
<td><input type="text" id="contractoremail" name="ContractorEmail" title="Enter contractor's email address here" /></td>
</tr>
<tr>
<td align="right" id="accountnumberlabel">Account Number:</td>
<td colspan="2"><input type="text" id="accountnumber" name="AccountNumber" size="46" title="Enter account number for requested upgrade here"/></td>
</tr>
</td>
</tr>
</table>
</fieldset>
<!--###################################### SERVICE INFORMATION FIELDSET ######################################-->
<fieldset style="border: 1px black solid">
<legend style="font-weight:bold"><u>Service Information</u></legend>
<table>
<tr>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<td>
<tr>
<td align="right" id="serviceaddresslabel">Service Address:</td>
<td><input type="text" id="serviceaddress" name="ServiceAddress" title="Location of requested service"/></td>
</tr>
<tr>
<td align="right" id="unitlabel">Unit #:</td>
<td align="left"><input type="text" id="unitnumber" name="UnitNumber" title="Unit for requested service"/></td>
</tr>
<tr>
<td align="right" id="servicetypelabel">Service Type:</td>
<td align="left">
<select class="my_dropdown" name="ServiceType" id="servicetype" title="Select the type of service you require">
<option value="-1" selected>[select--service]</option>
<option value="1">Upgrade</option>
<option value="2">Temporary</option>
<option value="3">New Permanent</option>
<option value="4">Other</option>
</select>
</td>
</tr>
<tr>
<td align="right" id="customerclasslabel">Customer Class:</td>
<td align="left">
<select class="my_dropdown" name="CustomerClass" id="customerclass" title="Select the type of account the service is for">
<option value="-1" selected>[select--type]</option>
<option value="1">Residential</option>
<option value="2">Commercial</option>
<option value="3">Industrial</option>
</select>
</td>
</tr>
<tr>
<td align="right" id="proposedloadlabel">Proposed Load:</td>
<td align="left"><input type="text" id="proposedload" name="ProposedLoad" size="10" title="Enter the proposed Kilowatt load the upgrade will handle"/>kW</td>
</tr>
<tr>
<td align="right" id="proposedmainlabel">Proposed Main Switch:</td>
<td align="left"><input type="text" id="proposedmainswitch" name="ProposedMainSwitch" size="10" title="Enter the proposed Amperage (Amps) load the main switch will handle"/>A</td>
<td align="left" id="existingmainlabel">Existing Main Switch:</td>
<td align="left"><input type="text" id="existingmainswitch" name="ExistingMainSwitch" title="Enter the current Amperage load the main switch handles"size="10"/>A</td>
</tr>
<tr>
<td align="right" id="voltagelabel">Voltage:</td>
<td align="left">
<select class="my_dropdown" name="Voltage" id="voltage" title="Select the Voltage rating required">
<option value="-1" selected>[select--voltage]</option>
<option value="1">240/120V</option>
<option value="2">208/120V</option>
<option value="3">600/347V</option>
</select>
</td>
</tr>
<tr>
<td align="right" id="phaselabel">Phase:</td>
<td align="left">
<select class="my_dropdown" name="Phase" id="phase" title="Select the upgrade phase preferred">
<option value="-1" selected>[select--phase]</option>
<option value="1">Single-Phase</option>
<option value="2">Three-Phase</option>
</select>
</td>
</tr>
<tr>
<td align="right" id="powersupplylabel">Power Supply:</td>
<td align="left">
<select class="my_dropdown" name="PowerSupply" id="powersupply" width="90" title="Select position of power supply required">
<option value="-1" selected size>[select--supply]</option>
<option value="1">Overhead (OH)</option>
<option value="2">Underground (UG)</option>
<option value="3">OH to UG</option>
<option value="4">UG to OH</option>
</select>
</td>
</tr>
<tr>
<td align="right" id="meterbaselabel">Meter Base Location:</td>
<td align="left">
<select class="my_dropdown" name="MeterBaseLocation" id="MeterBaseLocation" title="Select the location of the Meter">
<option value="-1" selected>[select--location]</option>
<option value="1">Existing Outside</option>
<option value="2">Inside Moving Out</option>
<option value="3">Relocate</option>
<option value="4">Ganged Position*</option>
</select>
<td align="left"><input type="text" id="existingmainswitch" name="ExistingMainSwitch" size="5" title="If meter location requires a Ganged (multiple) position installation, how many positions are needed?"/>*Positions</td>
</td>
</tr>
</td>
</tr>
</table>
</fieldset>
<table>
<tr>
<td align="center" id="commentslabel" title="Anything you want to add? Tell us here"><b><u>Comments/Reason for Upgrade:</b></u></td>
</tr>
<tr>
<td><textarea align="center" id="comments" rows="4" cols="80" style="border: 1px black solid" title="Anything you want to add? Tell us here"></textarea></td>
</tr>
<tr>
<td align="left">
<input type="checkbox" align="left" id="consent" value="consent1"><b> I confirm that the information I have given in this form is true to the best of my knowledge.</b><br>
<input type="checkbox" align="left" id="consent" value="consent2"><b>
I acknowledge and accept that if we schedule the connection to be done after hours (3:30PM) a charge
of $415 + HST will be added to my electricity bill for the month. </b><br>
</td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="formSubmit" value="Submit Application"></td>
</tr>
</table>
</form>
</body>
I've created a 'starter' file to test my form. I've only included a few variables for field testing as I'm not sure if I'm doing it the right way to output it to a CSV file. (CSV output required by employer)
Here is my action handler file named export.php:
<?php
$fn = $_POST['customername'];
$ln = $_POST['contractorname'];
// $address = $_POST['address'];
//validate
if(empty($fn) || empty($ln) || empty($address) || empty($city) || empty($state) || empty($zip) || empty($phone) || empty($email)){//show the form
$message = 'Fill in areas in red!';
$aClass = 'errorClass';
}
//this is where the creating of the csv takes place
$cvsData = $fn . "," . $ln ."\n";
$fp = fopen("formTest.csv","a"); // $fp is now the file pointer to file $filename
if($fp){
fwrite($fp,$cvsData); // Write information to the file
fclose($fp); // Close the file
}
?>
I am trying to output to a file for testing named formTest.csv. Currently I believe I'm having issues with PHP on my PC at work, as the network admins restrict access on our computers they were the ones who set it up while I was away. Currently when I click submit it just opens my export.php page, which is why I say my issue is PHP on my machine. But when I tested this on my home PC which SHOULD have PHP working (but it has been a while), it would return to my form but nothing would be input into the CSV.
Any tips?

Form not submitting html php

My form is not submitting, My database insert class works and I have tested. But my form seems not to want to submit or post values from my form. Is there something I left out?
<form name="form1" method="post" action="sub_newsletter.php" enctype="multipart/form-data">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2">Newsletter</td>
</tr>
<tr>
<td>Name : </td>
<td><input name="name" type="text"></td>
</tr>
<tr>
<td>Email : </td>
<td><input name="email" type="text"></td>
</tr>
<tr>
<td> <input type="text" name="check_spam" id="check_spam" size="30" style="display:none;" /> </td>
<td> </td>
</tr>
<tr>
<td colspan="2" align="center"><input type="image" name="submit" src="images/sub.jpg" style="width:180px; height:70px;"></td>
</tr>
</form>
</table>
My submit script
<?php
include('includes/database.php');
include('includes/settings.php');
include('includes/newsletter.php');
if (isset($_POST['submit'])){
//to check if posting
echo $username=rtrim($_POST['name']);
echo $myemail=rtrim($_POST['email']);
//
$check=$_POST['check_spam'];
if(!empty($check)){ echo "You are spam"; } else{
$username=rtrim($_POST['name']);
$myemail=rtrim($_POST['email']);
$news = new Newsletter();
$new->first_name=$username;
$new->email=$myemail;
$new->create();
echo "<script>alert(\"Thank you for your subscription\"); </script>";
echo "<script>window.location.replace(\"index.html\"); </script>";
}
}
?>
You obviously missed submit button
<input type="submit" name="submit">
Since you have already a field with that name, just change it or use a different name.

Error Placing on same page PHP

some of my code in addUser.php it pure html
addUser.php
<form action="process/addNewUser.php" method="POST" id="userForm">
<table width="79%" border="0" cellspacing="6" cellpadding="1"
class="tabcont">
<tr>
<td width="47%" align="right">Title:</td>
<td width="53%">
<select name="title"><option value='0'>- - select - -</option>
</select>
</td>
</tr>
<tr>
<td width="47%" align="right">
First Name:</td>
<td width="53%"><input type="text" id="firstname" name="firstName" class="required" /></td>
</tr>
<tr>
<td align="right">Middle Name:</td>
<td><input type="text" id="middlename" name="middleName" class="name" /></td>
</tr>
<tr>
<td align="right">Password:</td>
<td><input name="password" value="" readonly="readonly"
id="password" class="required" " /></td>
</tr>
<tr>
<td align="right" colspan="2">
<input name="addNewUser" type="submit" class="submit" id="submit" value="Submit" />
</td>
</tr>
</table>
</form>
addNewUser.php
Here i am doing validations and displaying error messages and if it is success sending him to another page.
But i want to show an error message on addUser.php instead of validations page. Please give me a sample code how i can do it.
addNewUser.php
Add the message in the session
$_SESSION["ErrorMsg"]="Name already exists";
And in your addUser.php , you put the following code in the place you need to show the msg :
if($_SESSION["ErrorMsg"])
{
echo $_SESSION["ErrorMsg"];
$_SESSION["ErrorMsg"]="";
}

securimage validation

hi everyone i am trying to get validate captcha on my form but i would like validation to take place on the form without a change of state.
currently the page refreshes to display the error message and the page loses all form values and i can understand that this can be frustrating to users who have to retype the information.
how can i get the error message to display right below the captcha image area? this way the user can make the necessary corrections to their mistake without re-entering everything.
<?php session_start();
include_once ("resources/Connections/kite.php");
include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';
$securimage = new Securimage();
?>
<div class="c13">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="69%" align="center"><p class="c6">New Account</p>
<?php
$username = mysql_real_escape_string($_POST['username']);
$email = mysql_real_escape_string($_POST['email']);
$password = mysql_real_escape_string($_POST['password']);
$password = mysql_real_escape_string($_POST['password2']);
//check if the form has been submitted
if(isset($_POST['submit'])){
if ($securimage->check($_POST['captcha_code']) == false) {
// the code was incorrect
// you should handle the error so that the form processor doesn't continue
// or you can use the following code if there is no validation or you do not know how
echo "The security code entered was incorrect.<br /><br />";
echo "Please go <a href='javascript:history.go(-1)'>back</a> and try again.";
}
else
//success
echo '<p class="c7">Thanks for signing up. We have just sent you an email at <b>'.$email.'</b>. Please click on the confirmation link within this message to complete registration.<br><img src="resources/img/spacer.gif" alt="" width="1" height="20"><br><span class="c12">
<input name="" type="button" class="c11" value="Register" onClick="location.href=\'main.php\'"/>
</span><br><img src="resources/img/spacer.gif" alt="" width="1" height="15"></p></div>';
include_once ("resources/php/footer.php");
exit;
}
?>
<p class="c7">Just enter your details to get started</p>
<div class="c10">
<form action="<?php echo $PHP_SELF;?>" method="post" id="register" name="register">
<table width="100%" border="0" cellpadding="0" cellspacing="">
<tr>
<td colspan="3" class="c8" height="25px" valign="bottom">Username</td>
</tr>
<tr>
<td width="46%"></td>
<td width="46%"></td>
<td width="54%" class="c8"></td>
</tr>
<tr>
<td colspan="3" class="c8"><span id="sprytextfield2">
<input name="username" type="text" class="required"/>
<span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldMaxCharsMsg">Exceeded maximum number of characters.</span></span></td>
</tr>
<tr>
<td colspan="3" class="c8" height="25px" valign="bottom">Email</td>
</tr>
<tr>
<td></td>
<td></td>
<td class="c8"></td>
</tr>
<tr>
<td colspan="3" class="c8"><span id="sprytextfield3">
<input name="email" type="text" class="required"/>
<span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldMaxCharsMsg">Exceeded maximum number of characters.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="3" class="c8" height="25px" valign="bottom">Password (minimum of 8 characters)</td>
</tr>
<tr>
<td></td>
<td></td>
<td class="c8"></td>
</tr>
<tr>
<td colspan="3" class="c8"><span id="sprytextfield4">
<input name="password" type="password" class="required" id="password"/>
<span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldMinCharsMsg">Minimum number of characters not met.</span><span class="textfieldMaxCharsMsg">Exceeded maximum number of characters.</span></span></td>
</tr>
<tr>
<td colspan="3" class="c8" height="25px" valign="bottom">Confirm Password</td>
</tr>
<tr>
<td></td>
<td></td>
<td class="c8"></td>
</tr>
<tr>
<td colspan="3" class="c8"><span id="spryconfirm1">
<input name="password2" type="password" class="required"/>
<span class="confirmRequiredMsg">A value is required.</span><span class="confirmInvalidMsg">The values don't match.</span></span></td>
</tr>
<tr>
<td colspan="3" class="c8" height="25px" valign="bottom">Enter Code</td>
</tr>
<tr>
<td colspan="3" class="c8"><img id="captcha" src="resources/securimage/securimage_show.php" alt="CAPTCHA Image" /> </td>
</tr>
<tr>
<td colspan="3" class="c8"><input type="text" name="captcha_code" size="10" maxlength="6" />
Swap image</td>
</tr>
<tr>
<td colspan="3" class="c8"><span class="c12"><img src="resources/img/spacer.gif" width="1" height="40" alt="" /></span></td>
</tr>
<tr>
<td colspan="3" class="c8"><span class="c12">
<input name="submit" type="submit" class="c11" value="Continue"/>
</span></td>
</tr>
</table>
</form>
</div>
<br /></td>
<td width="31%" valign="middle" align="center"> </td>
</tr>
</table>
</div>
The values that the user has entered are being sent also so why not access them and put them into the fields should there be an error
<input name="username" type="text" class="required" value="<?php echo $username ?>"/>
This will put whatever the user entered into the fields for you. Of course you need to setup all the relevant error checking.

Categories