Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

PHP: Comment traiter les champs obligatoire: à revoir


{filelink=12500}

<?php
if(isset($form_errors)):
?>
<ul>
<?php foreach($form_errorlist as $val): ?>
<li><?php echo $val;?>
<?php endforeach; ?>
</ul>
 
<?php endif; ?>
 
please fill out the following form (* = required)
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method=get>
<input type="hidden" name="submit" value="1">
<input type="hidden" name="required" value="phone,email,fax">
<input type="hidden" name="phone_desc" value="phone number">
<input type="hidden" name="email_desc" value="email address">
<input type="hidden" name="fax_desc" value="fax number">
your name:
<input type="text" name="name">
* your phone number:
<input type="text" name="phone" value="<?php echo (isset($_get['phone'])?$_get['phone']:$form_errors[0]='Voir phone') ?>">
* your email address:
<input type="text" name="email" value="<?php echo (isset($_get['email'])?$_get['email']:$form_errors[0]='Voir Email'); ?>">
* your fax number:
<input type="text" name="fax" value="<?php echo (isset($_get['fax'])?$_get['fax']:$form_errors[0]='Voir Fax') ?>">
<input type="submit" value="send">
</form>

No comments yet.

Leave a Comment