connect forms through php and primary key -
i'm trying connect forms using 1 of inputs form of primary key.
for example,
---first form primary key taken
form1.php
---second form, page1 based on input form1
form2.php?page1=primary key
---third form, page1 based on input form2
form3.php?page2=primary key
---fourth form, page2 page1
form4.php?page3=primary key
---fourth form, page3 page2
and on, until last page. question how connect them? how retrieve primary , pass on form involved? far can pass primary key form2, when reaches form3, disappears.
by way, after each form accomplished, proceeds process page.
---below code 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 his/her ability work 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 , complete in details</td> <td width="30%" align="left"> o - outstanding </td> </tr> <tr> <td width="70%"> b. thorough work; commit errors</td> <td width="30%" align="left"> vs - satisfactory </td> </tr> <tr> <td width="70%"> c. completes work few errors</td> <td width="30%" align="left"> s - satisfactory </td> </tr> <tr> <td width="70%"> d. work incomplete, inaccurate</td> <td width="30%" align="left"> - unsatisfactory</td> </tr> <tr> <td width="70%"> e. careless work; errors 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 code 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 code function
function eval_2(){ //page 2 $current=$_get['page1']; // $command="select recentact 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' student='$current'"; $query=mysql_query($sql)or die ("error".mysql_error()); } // header("location: performanceeval3.php?session=$current"); }
where did go wrong? should do? help!
i think didn't pass query string
in below variable null there no parameter value assign page1
$current=$_get['page1'];
and 1 more think submit button click action of form in loaded
may u try this
<form id="form1" name="form1" method="post" action="eval_2.php?page1=form1">
Comments
Post a Comment