Hello lovely people :-*
I have been learning PHP for a few weeks now. I am so excited lol.
I wrote my first simple PHP script, which checks the required fields.
Could you please check and let me know if it is correct or i should change something??
I would appreciate any advice.
[php]
<?php //PHP CHECK AND DISPLY FROM STARS if(isset($_POST['submit'])){ if(empty($_POST['name'])){ echo "Name field is required
"; } if(empty($_POST['email'])){ echo"Email field is required
"; } } if(isset($_POST['submit'])){ if(!empty($_POST['name']) && !empty($_POST['email'])){ echo "Hello "."".htmlentities($_POST['name']).""." Thank you for contacting. This is your email:"; echo "".htmlentities($_POST['email']).""; } } else{ echo""; } //PHP CHECK AND DISPLY FROM ENDS // HTML FROM STARTS echo""; echo"Name:
"; echo" Email:
"; echo" "; //FORM ENDS ?>
[/php]
Thanks
KG