Hi
I have a complicated problem and I hope you can solve it.
Here is the problem:
I'm designing a website that is used to enter students' marks and also the students can access this website to get their marks.
The general design of my website is the user, either teacher or student, log in then they will get the page that has the button of either enter marks or show marks. This page consists of welcome+id of user and the button, e.g. the student whose id is 12345 will get this page:
Welcome 12345
Button of "Show Marks"
Now, the problem with the page of show marks. In show marks page, I will search the id of student in the database then I will select his/her marks and show them in the page. The problem is how I can use the id in the show marks page. First, I thought about asking the student to enter his id again but it is not a good idea.
So, Is there any way I can use to use id that the student entered to search in the database?
I hope you got the idea.
Thank you
1 reply to this topic
#1
Posted 25 April 2011 - 11:16 AM
|
|
|
#2
Posted 25 April 2011 - 12:11 PM
Just add an hidden field with the id in the form the button is in:
the better way, is to store the information in a session, much safer!
echo "Welcome $id"; echo '<form method="post" action="showmarks.php">'; echo '<input type="hidden" name=id" value="'.$id.'">'; echo '<input type="submit" name="showmarks" value="Show Marks">'; echo '</form>'
the better way, is to store the information in a session, much safer!
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
I study Information Systems at Karlstad University when I'm not on CodeCall
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









