Hi All,
What I want to do:
I have 3 pages.
Page 1 has a form and form action takes control to page 2.
At Page 2 I do some processing and send result at page 3.
at Page 3 after some more processing control is send back to Page 1.
When control passes from page1 to page2 , I require all the data from Page1 to Page 2 and from Page 2 to Page3 and Page 3 to back to Page1.
To achive the required I used approch 1 which is javascript dependent. I used this because Approch 2 failed.
Can you please tell me the difference between the given two approches? Or Can you tell me which one is better and why?
Regards,
Ranjan
Approch 1:
$target=$path['main'].'/payCredits.php?jd='.$data['jobGrade'].'&userId='.$loginId;
echo"<font color='#FFFFFF'>-</font>";
$form='';
$form .= <<< FORM
<form name=sendform method=post action="$target">
<input type="hidden" name="userId" value="{$loginId}">
<input type="hidden" name="schoolId" value="{$data['schoolName']}">
<input type="hidden" name="title" value="{$data['jobTitle']}">
<input type="hidden" name="shortDesc" value="{$data['shortIntro']}">
<input type="hidden" name="longDesc" value="{$data['body']}">
<input type="hidden" name="jobType" value="{$data['jobType']}">
<input type="hidden" name="jobGrade" value="{$data['jobGrade']}">
<input type="hidden" name="salary" value="{$data['salary']}">
<input type="hidden" name="proofRead" value="{$data['proofRead']}">
</form>
<script>
sendform.submit();
</script>
FORM;
echo $form;
exit;
Approch 2:
if($data['jobGrade'] != 'bronze'){
$arrayToBePosted = array('schoolId' => '{$data['schoolName']}', 'title' => '{$data['jobTitle']}', 'shortDesc' => '{$data['shortIntro']}', 'longDesc' => '{$data['body']}', 'jobType' => '{$data['jobType']}', 'jobGrade' => '{$data['jobGrade']}', 'salary' => '{$data['salary']}', 'proofRead' => '{$proofRead}','userId'=> $loginId);
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$path['main'].'/payCredits.php');
curl_setopt($ch,CURLOPT_POST,true);
curl_setopt($ch,CURLOPT_POSTFIELDS,$arrayToBePoste d);
curl_exec($ch);
curl_close($ch);
}