I want to add form data into an array using session.
How can I do this please help me.
My HTML form is:
<form action="#" method="post">
Roll No:<input type="text" name="rollno" value="" id="rollno" />
<input type="submit" name="submit" value="Submit" />
</form>
And my PHP code is:
<?php
session_start();
$_SESSION['rollno'] = isset($_POST['rollno']);
echo $_SESSION['rollno'];
?>
I want to insert roll no into an array.
I have a record of 10 students. When I am inserting the first student Roll No then it prints the roll no, but when I insert the second student Roll No it overwrites the first student record.
I want to display all 10 student roll nos on same page.
How can I do this?
#as the action such as<form action="#" method="post">. Think it is a good idea?