60 397
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #27750 in AJAX | JavaScript | HTML | PHP for Emmanuel NDATIMANA

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.
Expert's answer
You can use the next code:<html>


<body>


<?php


if(isset($_POST['FirstName'])) echo 'First Name is
'.$_POST['FirstName'].'<br/>'; //if we receive any data - print not null
on page


if(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 age
of user


if($_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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions