I’m trying to connect forms using one of the inputs as a form of primary key.
For example,
—first form where the primary key is taken
form1.php
—second form, where page1 is based on an input from form1
form2.php?page1=primary key
—third form, where page1 is based on an input from form2
form3.php?page2=primary key
—fourth form, where page2 is page1
form4.php?page3=primary key
—fourth form, where page3 is page2
and so on, until the last page. My question is how do i connect them? how do i retrieve the primary and pass it on all the form involved? So far I can only pass the primary key up to form2, when it reaches form3, it disappears.
By the way, after each form is accomplished, it proceeds to a process page.
—below is the code for a sample form
<form id="form1" name="form1" method="post" action="eval_2.php">
<table width="100%" border="0" cellpadding="2" cellspacing="0">
<tr>
<td width="70%">
<strong>1. Quality of Work </strong><br />
- refers to his/her ability to work with thoroughness.
</td>
<td align="center"> <select name="qualityremark">
<option>Select Remark</option>
<option>O</option>
<option>VS</option>
<option>S</option>
<option>US</option>
<option>P</option>
</select></td>
</tr>
<tr>
<td width="70%" height="10%"> a. Works outstandingly accurate and complete in details</td>
<td width="30%" align="left"> O - Outstanding </td>
</tr>
<tr>
<td width="70%"> b. Does thorough work; rarely commit errors</td>
<td width="30%" align="left"> VS - Very Satisfactory </td>
</tr>
<tr>
<td width="70%"> c. Fairly completes work with few errors</td>
<td width="30%" align="left"> S - Satisfactory </td>
</tr>
<tr>
<td width="70%"> d. Work is often incomplete, inaccurate</td>
<td width="30%" align="left"> US - Unsatisfactory</td>
</tr>
<tr>
<td width="70%"> e. Very careless work; errors frequently repeated</td>
<td width="30%" align="left"> P - Poor</td>
</tr>
<tr>
<td> Comments: </td>
<td></td>
</tr>
<tr>
<td><textarea name="qualitycomment" cols="80" rows="5" id="qualitycomment"></textarea></td>
</tr>
</table>
<tr>
<td></td>
<td><div align="right">
<a href="performanceeval.php">Back</a> |
<!--<a href="performanceeval3.php">Next</a> -->
<input type="submit" value="Next" name="next" id="next" class="silver_button"/> </div></td>
</tr><br />
</form>
—below is the code for the process page
require_once("dbconnect_gentemplate.php");
require_once("attendanceClass.php");
$newAcct= new attendance();
$m=$newAcct->eval_2();
$current=$_GET['page1'];
header("Location: performanceeval3.php?page2=$current");
—below is the code for a function
function eval_2(){ //page 2
$current=$_GET['page1'];
// $command="select recentact from ojt_evaluation";
// $commando=mysql_query($command) or die("Error ".mysql_error());
// $commander=mysql_fetch_array($commando);
// $current=$commander['recentact'];
// $cur=md5($current);
if(isset($_POST['next'])){
$qualityremark=$_POST['qualityremark'];
$qualitycomment=$_POST['qualitycomment'];
if(trim($qualityremark)=="") return "<p>Error creating account;blank qualityremark</p>";
$sql="update ojt_evaluation set qualityremark='$qualityremark', qualitycomment='$qualitycomment' where student='$current'";
$query=mysql_query($sql)or die ("Error".mysql_error());
}
// header("Location: performanceeval3.php?session=$current");
}
Where did I go wrong? What should I do? Help!
i think you didn’t pass any query string
in the below variable will be null there is no parameter value assign to page1
and one more think the submit button will click the action of form in loaded
may u try this