Hi All,
I have an assignment to complete and I just can't get it and I was hoping someone could help me out. What I need to do is:
Call the session_start function.
Detect whether or not the name session variable has a value; if so, display name and age as text; if not, display the name and age input fields.
How can have the text fields replaced with the users Name and age after they type it in and submit the form? So, when they go back to the that page, they will already see their name and age printed out in place of the text fields. I also upload an image of what it is suppose to look like.
Thanks in advance for your help,
T
I have an assignment to complete and I just can't get it and I was hoping someone could help me out. What I need to do is:
Call the session_start function.
Code:
<?php session_start(); ?>
Code:
First name: <input type="text" name="fname" /> Age: <input type="text" name="age" /> <input type="submit" name="submit" value="Submit" /> <?php if (isset($_POST['submit'])) { $_session['fname'] = $_POST['fname']; $_session['age'] = $_POST['age']; } ?>
Thanks in advance for your help,
T
Comment