Question #27750
which PHP_HTML codes can I use to submit (FirstName, LastName and Ages), and displaying entered data. But , if entered age is < 18 displaying that"You're kid"
>18 and<35 displaying that"You're mature"
> 35 displaying that"You' re old!!!"
THANKS, I NEED YOUR HELP.
1
Expert's answer
2013-04-11T04:13:34-0400
You can use the next code:<html><body><?phpif(isset($_POST['FirstName'])) echo 'First Name is'.$_POST['FirstName'].'<br/>'; //if we receive any data - print not nullon pageif(isset($_POST['LastName'])) echo 'Last Name is'.$_POST['LastName'].'<br/>';if(isset($_POST['Age'])){ echo 'Age is'.$_POST['Age'].'<br/>';if($_POST['Age']<18) echo 'You're kid'; //checking ageof userif($_POST['Age']>=18 && $_POST['Age']<35) echo'You're mature';if($_POST['Age']>=35) echo 'You're old!!!'; }?><form action="?" method="POST" >First Name<br/><input type="text"name="FirstName"><br/>Last Name<br/><input type="text" name="LastName"><br/>Age<br/><input type="text"name="Age"><br/><input type="submit"value="Submit"><br/></form></body><html>

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS