BrotherBear Posted March 30, 2007 Share Posted March 30, 2007 Hi I have a contact form and want to verify that all spaces are filled so I putted some code and works the only problem is that when it tells you the error the text appears in the top of the form page and I want it to appear below te space or wherever I want here's the code $Name = $_POST['Name']; $Age = $_POST['Age']; $Email = $_POST['Email']; $Comments = $_POST['Comments']; if ($Name==0) echo "Please fill the spaces completely"; include ("contactus.html"); exit(); what can I do to make the error text appear wherever I want? thanks BB Link to comment https://forums.phpfreaks.com/topic/44856-solved-php-form-help/ Share on other sites More sharing options...
Waldir Posted March 30, 2007 Share Posted March 30, 2007 define the error in a variable and than echo it on ur form $Name = $_POST['Name']; $Age = $_POST['Age']; $Email = $_POST['Email']; $Comments = $_POST['Comments']; if ($Name==0) $error = "Please fill the spaces completely"; include ("contactus.html"); exit(); now inside youe contacus.html page have something like this <input type="text"> <font color="red"><?=$error?></font> Link to comment https://forums.phpfreaks.com/topic/44856-solved-php-form-help/#findComment-217842 Share on other sites More sharing options...
BrotherBear Posted March 30, 2007 Author Share Posted March 30, 2007 thank you I'll try that let me see if it works thanks again BB Link to comment https://forums.phpfreaks.com/topic/44856-solved-php-form-help/#findComment-217848 Share on other sites More sharing options...
BrotherBear Posted March 30, 2007 Author Share Posted March 30, 2007 thank u very much it does work perfectly thanks BB Link to comment https://forums.phpfreaks.com/topic/44856-solved-php-form-help/#findComment-217850 Share on other sites More sharing options...
Waldir Posted March 30, 2007 Share Posted March 30, 2007 no prblem, please mark as solved Link to comment https://forums.phpfreaks.com/topic/44856-solved-php-form-help/#findComment-217852 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.