I have one question, how to set the error for requiered fields? For example, if (in my case) birth year is not choosen, redirect to error.php( i do it ), but i want to that field is with red, and error in the bottom of the page(please fill (again in my case) birth year) ?
- Code: Select all
<?php
function write_data($label,$start,$end)
{
if($label=="birth_year")
echo "birth year: <select name=\"$label\">\n";
else
echo "$label: <select name=\"$label\">\n";
echo "<option value=>choose</option>\n";
$i=$start;
while($i>=$end)
{
echo "<option value=\"$i\">$i</option>\n";
$i--;
}
echo "</select>\n";
}
write_data("birth_year",1992,1900);
write_data("month",12,1);
write_data("day",31,1);
?>
and my only with error text code
- Code: Select all
<?php
$p="";
$p=$_GET["order_error"];
if ($p==1)
echo '<br /><span id="error">Please fill all fields</span>';
?>
With css I format #error.

