how to call previous value in first page to the next page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
azzahra
Forum Newbie
Posts: 1
Joined: Sat Aug 09, 2008 2:02 am

how to call previous value in first page to the next page

Post by azzahra »

I need your help...

i make lecturer evaluation system for my undergraduate project...
In this system consist three parts of evaluation...in part 1 student need to choose the subject code and the lecturer's name and answer the questions, after that the student need to click button next, when click the button next the page of evaluation part II will display..how to call the subject code and lecturer's name from part 1 into part II..
can anybody help me?
desmi
Forum Commoner
Posts: 64
Joined: Sun Jun 15, 2008 4:55 am

Re: how to call previous value in first page to the next page

Post by desmi »

Could you post what your first page looks like?

easier to help that way

Here's one way to do it:

part1.php

Code: Select all

...
<body>
<?php
    //Echo form (can be done without php too..)
    echo "<form action='part2.php' method='post'>\n";
    echo "<input type='text' name='subjectcode' id='subjectcode' value='Type subject code here'>\n";
    echo "<input type='text' name='lecturername' id='lecturername' value='Type lecturer's name here'>\n";
    echo "<input type='text' name='answer' id='answer' value='Type your answer here'>\n";
    echo "<input type='submit' value='Submit' />";
    echo "</form>";
    
?>
 
</body>
...
part2.php

Code: Select all

...
<body>
 
<?php
 
    $subject = $_POST['subjectcode'];
    $lecturer = $_POST['lecturername'];
    $answer = $_POST['answer'];
 
    //Then do what ever you want with these $variables..
    
?>
</body>
...
You can ofcourse make a select-box for student codes and lecturer names too..
Post Reply