clonmelog
asked on
$id value doesnt carry through redirected page
Hi,
Im using the following page to carry form data over to a payment page:
<?php
session_start();
header("Cache-control: private");
include 'db.php';
$id = $_POST['id'];
$price = $_POST['price'];
$uname=$_SESSION['uname'];
?>
<?php function redirect($url)
{
echo '<script language="JavaScript">
document.location.href="' . $url . '"
</script>';
echo "If you do not get redirected <a href=\"" . $url . "\">click here</a>.";
}
?>
<?php
$isError=false;
$error_firstname=$error_su rname=$err or_yob=$er ror_street 1=$error_s treet2=$er ror_tow=$e rror_city= $error_pho ne=$countr y="";
$dob=$mob=1;
$email=$firstname=$surname =$yob=$str eet1=$stre et2=$town= $city=$pho ne="";
if (isset($_POST["submit_x"]) && $_POST["submit_x"])
{
foreach ($_POST as $key => $value)
$$key = $value;
if (strlen($firstname) < 3) {
$isError = true;
$error_firstname = "<img src='images/error.gif'>";
}
if (strlen($surname) < 3) {
$isError = true;
$error_surname = "<img src='images/error.gif'>";
}
if (strlen($yob) < 4) {
$isError = true;
$error_yob = "<img src='images/error.gif'>";
}
if (strlen($street1) < 3) {
$isError = true;
$error_street1 = "<img src='images/error.gif'>";
}
if (strlen($street2) < 3) {
$isError = true;
$error_street2 = "<img src='images/error.gif'>";
}
if (strlen($town) < 3) {
$isError = true;
$error_town = "<img src='images/error.gif'>";
}
if (strlen($city) < 3) {
$isError = true;
$error_city = "<img src='images/error.gif'>";
}
if (strlen($phone) < 3) {
$isError = true;
$error_phone = "<img src='images/error.gif'>";
}
if(!$isError)
{
//process form
$_SESSION = $_POST;
redirect("https://www.templateit.net/safepayment.php");
exit;
}
?>
<?php
//email function
function validate_email($str)
{
$str = strtolower($str);
if(ereg("^([^[:space:]]+)@ (.+)\.(ad| ae|af|ag|a i|al|am|an |ao|aq|ar| arpa|as|at |au|aw|az| ba|bb|bd|b e|bf|bg|bh |bi|bj|bm| bn|bo|br|b s|bt|bv|bw |by|bz|ca| cc|cd|cf|c g|ch|ci|ck |cl|cm|cn| co|com|cr| cu|cv|cx|c y|cz|de|dj |dk|dm|do| dz|ec|edu| ee|eg|eh|e r|es|et|fi |fj|fk|fm| fo|fr|fx|g a|gb|gov|g d|ge|gf|gh |gi|gl|gm| gn|gp|gq|g r|gs|gt|gu |gw|gy|hk| hm|hn|hr|h t|hu|id|ie |il|in|int |io|iq|ir| is|it|jm|j o|jp|ke|kg |kh|ki|km| kn|kp|kr|k w|ky|kz|la |lb|lc|li| lk|lr|ls|l t|lu|lv|ly |ma|mc|md| mg|mh|mil| mk|ml|mm|m n|mo|mp|mq |mr|ms|mt| mu|mv|mw|m x|my|mz|na |nato|nc|n e|net|nf|n g|ni|nl|no |np|nr|nu| nz|om|org| pa|pe|pf|p g|ph|pk|pl |pm|pn|pr| pt|pw|py|q a|re|ro|ru |rw|sa|sb| sc|sd|se|s g|sh|si|sj |sk|sl|sm| sn|so|sr|s t|sv|sy|sz |tc|td|tf| tg|th|tj|t k|tm|tn|to |tp|tr|tt| tv|tw|tz|u a|ug|uk|um |us|uy|uz| va|vc|ve|v g|vi|vn|vu |wf|ws|ye| yt|yu|za|z m|zw)$",$s tr))
{
return 0;
} else {
return 1;
}
}
}
?>
<?php
if (!$submit || !$submit_x || $isError)
{
?>
<html>
<head>
<title>Purchase - Payment Details::</title>
<meta http-equiv="Content-Style- Type" content="text/css">
<LINK HREF="style.css" TYPE="text/css" REL="stylesheet">
<style type="text/css">
<script type="text/javascript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(p arseInt(ap pVersion)= =4)) {
document.MM_pgW=innerWidth ; document.MM_pgH=innerHeigh t; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_p gW || innerHeight!=document.MM_p gH) location.reload();
}
MM_reloadPage(true);
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x= a[i])&&x.o Src;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_pre loadImages .arguments ; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&p arent.fram es.length) {
d=parent.frames[n.substrin g(p+1)].do cument; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length; i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d. layers.len gth;i++) x=MM_findObj(n,d.layers[i] .document) ;
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arg uments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+= 3)
if ((x=MM_findObj(a[i]))!=nul l){documen t.MM_sr[j+ +]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head >
<body onLoad="MM_preloadImages(' images/dw_ butt_on.jp g','images /imode_but t_on.jpg', 'images/fl ash_butt_o n.jpg','im ages/css_b utt_on.jpg ')">
<div id="Layer1"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/til_2.j pg" style="background-repeat:r epeat-x; background-position:top "> </td>
<td width="766" align="left" valign="top"><table width="766" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="left" valign="top">
<td width="541" height="234"><img src="images/top_1.jpg" width="541" height="234"></td>
<td width="225"><table width="225" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="102" align="left" valign="top" background="images/back_1. jpg" class="style1"><label></la bel></td>
</tr>
<tr>
<td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="530" height="132" valign="top"><object classid="clsid:D27CDB6E-AE 6D-11cf-96 B8-4445535 40000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="106" height="130" title="menu">
<param name="movie" value="flash/menu.swf">
<param name="quality" value="high">
<embed src="flash/menu.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockw ave-flash" width="106" height="130"></embed>
</object></td>
<td width="119"><img src="images/top_2.jpg" width="119" height="132"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td width="372" rowspan="3" align="left" valign="top"><p>
<label></label>
<span class="HedingText">Puchase Your Template </span></p>
<p class="style3">To complete the purchase of your product simply fill out the form to the right of this page. Before you do so you should review the details of your purchace below and ensure that you have read the terms and conditions. </p>
<p class="style3">On confirmation of your purchase you will also be presented with a download dialog. Download times are dependant upon the speed of your connection. Should you have any problems simply visit the <a href="support.php">custome r support</a> area. </p>
<p>
<?php
echo "Product ID: "."$id"."<br />";
echo "Charge: "."$price"."<br />";
?>
Terms and conditions go here</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
<td width="13" rowspan="3" align="left" valign="top">
<td width="381" height="90" align="left" valign="top"><span class="style5">Please confirm your personal details below
</span>
<p>
<?php
$sql = mysql_query('SELECT * FROM users WHERE username = \''.$uname.'\'');
while($row = mysql_fetch_array($sql))
{
echo "Email: ".$row['email'];
}
?>
<br><form name="form1" method="post" action="<?php echo $PHP_SELF ?>">
<table width="61%" border="0">
<tr>
<td width="23%"> </td>
<td width="24%" class="warninngtxt"><font face="Times New Roman, Times, serif" class="NormalTxt">Firstnam e</font></ td>
<td width="46%"> <span class="warninngtxt">
<input name="firstname" type="text" class="textBoxNormal" onFocus="this.className='t extBoxActi ve'" onBlur="this.className='te xtBoxNorma l'" value="<?=$firstname?>">
</span></td>
<td width="7%" class="warninngtxt"><?=$er ror_firstn ame?></td>
</tr>
<tr>
<td width="23%"> </td>
<td width="24%" class="warninngtxt"><font face="Times New Roman, Times, serif" class="NormalTxt">Surname< /font></td >
<td width="46%"> <span class="warninngtxt">
<input name="surname" type="text" class="textBoxNormal" onFocus="this.className='t extBoxActi ve'" onBlur="this.className='te xtBoxNorma l'"value=" <?=$surnam e?>">
</span></td>
<td width="7%" class="warninngtxt"><?=$er ror_surnam e ?></td>
</tr>
<tr>
<td width="23%"> </td>
<td width="24%" class="warninngtxt"><font face="Times New Roman, Times, serif" class="NormalTxt">Date of Birth</font></td>
<td width="46%"> <span class="warninngtxt">
<select name="dob" class="textBoxNormal" id="dob">
<?
for ($i=1; $i<=31; $i++)
{
$s = ($i==(int)$dob) ? " selected=\"selected\"" : "";
$display = ($i<10?"0".$i:$i);
echo "<option value=\"$display\"$s>$disp lay</optio n>\r\n";
}
?>
</select>
<select name="mob" class="textBoxNormal" id="mob">
<?
for ($i=1; $i<=12; $i++)
{
$s = ($i==(int)$mob) ? " selected=\"selected\"" : "";
$display = ($i<10?"0".$i:$i);
echo "<option value=\"$display\"$s>$disp lay</optio n>\r\n";
}
?>
</select>
<input name="yob" type="text" class="textBoxNormal" id="yob" value="<?=$yob?>" size="4" maxlength="4">
</span></td>
<td width="7%" class="warninngtxt"><?=$er ror_yob?>< /td>
</tr>
<tr>
<td width="23%"> </td>
<td width="24%" class="warninngtxt"><font face="Times New Roman, Times, serif" class="NormalTxt">Street</ font></td>
<td width="46%"> <span class="warninngtxt">
<input name="street1" type="text" class="textBoxNormal" onFocus="this.className='t extBoxActi ve'" onBlur="this.className='te xtBoxNorma l'" value="<?=$street1?>">
</span></td>
<td width="7%" class="warninngtxt"><?=$er ror_street 1 ?></td>
</tr>
<tr>
<td width="23%"> </td>
<td width="24%" class="warninngtxt"><span class="NormalTxt">Line 2</span> </td>
<td width="46%"> <span class="warninngtxt">
<input name="street2" type="text" class="textBoxNormal" onFocus="this.className='t extBoxActi ve'" onBlur="this.className='te xtBoxNorma l'"value=" <?=$street 2?>">
</span></td>
<td width="7%" class="warninngtxt"><?=$er ror_street 2 ?></td>
</tr>
<tr>
<td width="23%"> </td>
<td width="24%" class="warninngtxt"><font face="Times New Roman, Times, serif" class="NormalTxt">Town</fo nt></td>
<td width="46%"> <span class="warninngtxt">
<input name="town" type="text"class="textBoxN ormal" onFocus="this.className='t extBoxActi ve'" onBlur="this.className='te xtBoxNorma l'" value="<?=$town?>">
</span></td>
<td width="7%" class="warninngtxt"><?=$er ror_town?> </td>
</tr>
<tr>
<td width="23%"> </td>
<td width="24%" class="warninngtxt"><font
face="Times New Roman, Times, serif" class="NormalTxt">City</fo nt></td>
<td width="46%"> <span class="warninngtxt">
<input name="city" type="text" class="textBoxNormal" onFocus="this.className='t extBoxActi ve'" onBlur="this.className='te xtBoxNorma l'"value=" <?=$city?> ">
</span></td>
<td width="7%" class="warninngtxt"><?=$er ror_city ?></td>
</tr>
<tr>
<td width="23%"> </td>
<td width="24%" class="warninngtxt"><font
face="Times New Roman, Times, serif" class="NormalTxt">Country< /font></td >
<td width="46%"> <span class="warninngtxt">
<select name="country" size="1" class="textBoxNormal">
<?
$country_array = array ("Ireland","Afganishtan"," Albania"," Algeria"," American Samoa","Andorra","Anguilla ","Antarti ca","Antig ua & Barbuda","Argentina","Arme nia");
//you can get this from your DB.
for ($i=0; $i<count($country_array); $i++)
{
$s = ($country_array[$i]==$coun try) ? " selected=\"selected\"":"";
echo "<option value=\"".$country_array[$ i]."\"$s>" .$country_ array[$i]. "</option> ";
}
?>
</select>
</span></td>
<td width="7%"> </td>
</tr>
<tr>
<td width="23%"> </td>
<td width="24%" class="warninngtxt"><font face="Times New Roman, Times, serif" class="NormalTxt">Phone</f ont></td>
<td width="46%"> <span class="warninngtxt">
<input name="phone" type="text" class="textBoxNormal" onFocus="this.className='t extBoxActi ve'" onBlur="this.className='te xtBoxNorma l'"value=" <?=$phone? >">
</span></td>
<td width="7%" class="warninngtxt"><?=$er ror_phone? ></td>
</tr>
</table>
</p>
<input name="id" id="id" type="hidden" value= "<?php echo "$id"; ?>">
<input name="price" id="price" type="hidden" value= "<?php echo "$price"; ?>"><p>
<label><input type="image" src="images/submit_button. jpg" align="absmiddle" border="0" name="submit"></label>
</form>
</p>
<tr>
<td height="34" align="left" valign="top">
<tr>
<td height="266" align="left" valign="top"> </td>
</tr>
<tr>
<td height="37" colspan="3" align="left" valign="top"><img src="images/line_1.jpg" width="766" height="5"></td>
</tr>
<tr>
<td colspan="3" align="center" valign="top"><div align="center" class="style3" style="padding-top:12px "><a href="index.php" style="color:#6A8BA4 ">About Us </a> &n bsp; || &n bsp; <a href="index.php" class="style3"> Produ cts</a>&nb sp; & nbsp;  ; ||& nbsp;  ; <a href="index.php"> Mem bers</a>&n bsp; &nbs p; || &nbs p; &n bsp;<a href="index.php" class="style3">Register</a ><a href="index.php"> </a > &nb sp; & nbsp;||&nb sp; & nbsp;  ; <a href="index.php" style="color:#6A8BA4 ">Contact Us</a><a href="index.php" style="color:#6A8BA4 "> </a></div>
<div style="padding-left:0px; padding-top:8px"><a href="index-5.html" class="style3" style="text-decoration:non e ">Copyright © templateit.net, 2005. All Rights Reserved</a></div></td>
</tr>
</table></td>
<td background="images/til_2.j pg" style="background-position :top; background-repeat:repeat-x "> </td>
</tr>
<tr>
<td> </td>
<td width="766" align="left" valign="top"> </td>
<td> </td>
</tr>
</table>
<?php
}
// end if
?>
</body>
</html>
and the page that it is redirecting to is as follows:
<?php
session_start();
$email = $_POST['email'];
$firstname = $_POST['firstname'];
$surname = $_POST['surname'];
$uname = 'TEST';
$id = $_POST['id'];
$dob = $_POST['dob'];
$mob = $_POST['mob'];
$yob = $_POST['yob'];
$street1 = $_POST['street1'];
$street2 = $_POST['street2'];
$town = $_POST['town'];
$city = $_POST['city'];
$country = $_POST['country'];
$C_CcType = $_POST['C_CcType'];
$C_CcNum = $_POST['C_CcNum'];
$C_ExpD = $_POST['C_ExpD'];
$C_Sec = $_POST['C_Sec'];;
?>
<?php echo "$id";?>
<html>
<head>
<title>Secure Payment Screen</title>
<meta http-equiv="Content-Style- Type" content="text/css">
<LINK HREF="style.css" TYPE="text/css" REL="stylesheet">
<style type="text/css">
<!--
#Layer1 {
position:absolute;
left:691px;
top:-7px;
width:0px;
height:29px;
z-index:1;
}
#Layer2 {
position:absolute;
left:702px;
top:5px;
width:101px;
height:28px;
z-index:2;
}
#Layer3 {
position:absolute;
left:130px;
top:252px;
width:278;
height:136;
z-index:2;
background-repeat: no-repeat;
background-image: url(images/bg_register.gif );
}
#Layer4 {
position:absolute;
left:129px;
top:463px;
width:350;
height:130;
z-index:3;
}
#Layer5 {
position:absolute;
left:535px;
top:252px;
width:302;
height:202;
z-index:4;
background-image: url(images/bg_product_brow se.gif);
}
#Layer6 {
position:absolute;
left:506px;
top:463px;
width:332;
height:167;
z-index:5;
background-image: url(images/bg_search.gif);
background-repeat: no-repeat;
}
#Layer7 {
position:absolute;
left:129px;
top:599px;
width:350px;
height:31px;
z-index:6;
background-color: #CCCCCC;
}
#Layer8 {
position:absolute;
left:135px;
top:471px;
width:314;
height:204;
z-index:5;
}
#Layer9 {
position:absolute;
left:130;
top:252;
width:278px;
height:136px;
z-index:2;
background-image: url(images/bg_register.gif );
background-repeat:no-repea t;
}
#Layer10 {
position:absolute;
left:130px;
top:399px;
width:278;
height:136;
z-index:3;
background-image: url(images/bg_register.gif );
background-repeat:no-repea t;
}
#Layer11 {
position:absolute;
left:455px;
top:324px;
width:278;
height:136;
z-index:4;
background-image: url(images/bg_login.jpg);
background-repeat:no-repea t;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(p arseInt(ap pVersion)= =4)) {
document.MM_pgW=innerWidth ; document.MM_pgH=innerHeigh t; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_p gW || innerHeight!=document.MM_p gH) location.reload();
}
MM_reloadPage(true);
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x= a[i])&&x.o Src;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_pre loadImages .arguments ; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&p arent.fram es.length) {
d=parent.frames[n.substrin g(p+1)].do cument; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length; i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d. layers.len gth;i++) x=MM_findObj(n,d.layers[i] .document) ;
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arg uments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+= 3)
if ((x=MM_findObj(a[i]))!=nul l){documen t.MM_sr[j+ +]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onLoad="MM_preloadImages(' images/dw_ butt_on.jp g','images /imode_but t_on.jpg', 'images/fl ash_butt_o n.jpg','im ages/css_b utt_on.jpg ')">
<div id="Layer1"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/til_2.j pg" style="background-repeat:r epeat-x; background-position:top "> </td>
<td width="766" align="left" valign="top"><table width="766" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="left" valign="top">
<td width="541" height="234"><img src="images/top_1.jpg" width="541" height="234"></td>
<td width="225"><table width="225" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="102" align="left" valign="top" background="images/back_1. jpg" class="style1"><label></la bel></td>
</tr>
<tr>
<td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="530" height="132" valign="top"><object classid="clsid:D27CDB6E-AE 6D-11cf-96 B8-4445535 40000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="106" height="130" title="menu">
<param name="movie" value="flash/menu.swf">
<param name="quality" value="high">
<embed src="flash/menu.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockw ave-flash" width="106" height="130"></embed>
</object></td>
<td width="119"><img src="images/top_2.jpg" width="119" height="132"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td width="372" rowspan="3" align="left" valign="top"><p>
<label></label>
</p>
<p><form name="form1" method="post" action="register1.php">
<p align="center"> </p>
<p align="center" class="style2"><strong>Ple ase Enter
the following details to complete your order </strong></p>
<p align="center" class="style1 ver11">
<input name="email" type="hidden" id="email" value="<?php echo $email; ?>">
<input name="fname" type="hidden" id="firstname" value="<?php echo $firstname; ?>">
<input name="surname" type="hidden" id="surname" value="<?php echo $surname; ?>">
<input name="dob" type="hidden" id="dob" value="<?php echo $dob; ?>">
<input name="mob" type="hidden" id="mob" value="<?php echo $mob; ?>">
<input name="yob" type="hidden" id="yob" value="<?php echo $yob; ?>">
<input name="street1" type="hidden" id="street1" value="<?php echo $street1; ?>">
<input name="street2" type="hidden" id="street2" value="<?php echo $street2; ?>">
<input name="town" type="hidden" id="town" value="<?php echo $town; ?>">
<input name="city" type="hidden" id="city" value="<?php echo $city; ?>">
<input name="phone" type="hidden" id="phone" value="<?php echo $phone; ?>">
<input name="country" type="hidden" id="country" value="<?php echo $country; ?>">
<input name="id" type="hidden" id="id" value="<?php echo $id; ?>">
</p>
<p align="center" class="style1"><b><font color="#FF0000">Payment Details</font></b></p>
<table width="69%">
<?
if(isset($_GET['payment_er ror']) and $_GET['payment_error']!='' ){
echo "<TR><TD COLSPAN=2><font color=\"#FF0000\" > & nbsp;  ; &nb sp; & nbsp;  ; <b> ERROR: ".$_GET['payment_error']." </b></font ></TD></TR >";
}
?>
<tr>
<td width="10%" rowspan="4"> </td>
<td width="39%" height="26"><span class="NormalTxt"></span>< span class="NormalTxt">Card
Type</span><span class="NormalTxt">:</span> </td>
<td width="51%"> <select name="C_CcType" class="textBoxNormal" id="select2">
<option selected value="1">Visa</option>
<option value="2">MasterCard</opti on>
<option value="3">American Express</option>
</select> </td>
</tr>
<tr>
<td width="39%" height="24"><span class="NormalTxt">Card Number:</span></td>
<td width="51%"> <input type="text" autocomplete="off" name="C_CcNum" class="textBoxNormal" onFocus="this.className='t extBoxActi ve'" onBlur="this.className='te xtBoxNorma l'">
</td>
</tr>
<tr>
<td width="39%" height="42" class="NormalTxt">Expiry Date:</td>
<td width="51%"> <input type="text" name="C_ExpD" autocomplete="off" class="textBoxNormal" onFocus="this.className='t extBoxActi ve'" onBlur="this.className='te xtBoxNorma l'">
<span class="NormalTxt">eg: 06/06 </span> </td>
</tr>
<tr>
<td width="39%" height="24" class="NormalTxt">Sec Code:</td>
<td width="51%"> <input type="text" autocomplete="off" name="C_Sec" class="textBoxNormal" onFocus="this.className='t extBoxActi ve'" onBlur="this.className='te xtBoxNorma l'">
</td>
</tr>
<tr>
<td height="24" colspan="3"><div align="right">
<input type="image" src="images/submit_button. jpg" align="middle" border="0" name="image">
</div></td>
</tr>
</table>
<p align="center" class="tahbol style1">
<input name="total" type="hidden" id="total" value="<?php echo $total; ?>">
<input name="p_method" type="hidden" id="p_method" value="<?php echo $p_method; ?>">
</p>
<p> </p>
<p>
</form> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
<td width="394" height="86" align="left" valign="middle"><a href="http://www.pixelscience.it"></a></td>
</tr>
<tr>
<td height="113" align="left" valign="top" class="style3"><div align="center"></div></td>
</tr>
<tr>
<td align="left" valign="top"> </td>
</tr>
<tr>
<td height="37" colspan="2" align="left" valign="top"><img src="images/line_1.jpg" width="766" height="5"></td>
</tr>
<tr>
<td colspan="2" align="center" valign="top"><div align="center" class="style3" style="padding-top:12px "><a href="index.php" style="color:#6A8BA4 ">About Us </a> &n bsp; || &n bsp; <a href="index.php" class="style3"> Produ cts</a>&nb sp; & nbsp;  ; ||& nbsp;  ; <a href="index.php"> Mem bers</a>&n bsp; &nbs p; || &nbs p; &n bsp;<a href="index.php" class="style3">Register</a ><a href="index.php"> </a > &nb sp; & nbsp;||&nb sp; & nbsp;  ; <a href="index.php" style="color:#6A8BA4 ">Contact Us</a><a href="index.php" style="color:#6A8BA4 "> </a></div>
<div style="padding-left:0px; padding-top:8px"><a href="index-5.html" class="style3" style="text-decoration:non e ">Copyright © templateit.net, 2005. All Rights Reserved</a></div></td>
</tr>
</table></td>
<td background="images/til_2.j pg" style="background-position :top; background-repeat:repeat-x "> </td>
</tr>
<tr>
<td> </td>
<td width="766" align="left" valign="top"> </td>
<td> </td>
</tr>
</table>
<?php
// end if
?>
</body>
</html>
The problem im having is with the $id isnt passing from the purchase2.php page to the payment page and i cant figure put why as all the other values are passing over no problems.
Apologies for the mass of code, Ive only posted all of it due to the fact that the forms are using hidden fields and are all part of the problem here i think.... is $id ok to use or is it reserved or anything?
Im using the following page to carry form data over to a payment page:
<?php
session_start();
header("Cache-control: private");
include 'db.php';
$id = $_POST['id'];
$price = $_POST['price'];
$uname=$_SESSION['uname'];
?>
<?php function redirect($url)
{
echo '<script language="JavaScript">
document.location.href="' . $url . '"
</script>';
echo "If you do not get redirected <a href=\"" . $url . "\">click here</a>.";
}
?>
<?php
$isError=false;
$error_firstname=$error_su
$dob=$mob=1;
$email=$firstname=$surname
if (isset($_POST["submit_x"])
{
foreach ($_POST as $key => $value)
$$key = $value;
if (strlen($firstname) < 3) {
$isError = true;
$error_firstname = "<img src='images/error.gif'>";
}
if (strlen($surname) < 3) {
$isError = true;
$error_surname = "<img src='images/error.gif'>";
}
if (strlen($yob) < 4) {
$isError = true;
$error_yob = "<img src='images/error.gif'>";
}
if (strlen($street1) < 3) {
$isError = true;
$error_street1 = "<img src='images/error.gif'>";
}
if (strlen($street2) < 3) {
$isError = true;
$error_street2 = "<img src='images/error.gif'>";
}
if (strlen($town) < 3) {
$isError = true;
$error_town = "<img src='images/error.gif'>";
}
if (strlen($city) < 3) {
$isError = true;
$error_city = "<img src='images/error.gif'>";
}
if (strlen($phone) < 3) {
$isError = true;
$error_phone = "<img src='images/error.gif'>";
}
if(!$isError)
{
//process form
$_SESSION = $_POST;
redirect("https://www.templateit.net/safepayment.php");
exit;
}
?>
<?php
//email function
function validate_email($str)
{
$str = strtolower($str);
if(ereg("^([^[:space:]]+)@
{
return 0;
} else {
return 1;
}
}
}
?>
<?php
if (!$submit || !$submit_x || $isError)
{
?>
<html>
<head>
<title>Purchase - Payment Details::</title>
<meta http-equiv="Content-Style-
<LINK HREF="style.css" TYPE="text/css" REL="stylesheet">
<style type="text/css">
<script type="text/javascript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(p
document.MM_pgW=innerWidth
else if (innerWidth!=document.MM_p
}
MM_reloadPage(true);
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_pre
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&p
d=parent.frames[n.substrin
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;
for(i=0;!x&&d.layers&&i<d.
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arg
if ((x=MM_findObj(a[i]))!=nul
}
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head
<body onLoad="MM_preloadImages('
<div id="Layer1"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/til_2.j
<td width="766" align="left" valign="top"><table width="766" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="left" valign="top">
<td width="541" height="234"><img src="images/top_1.jpg" width="541" height="234"></td>
<td width="225"><table width="225" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="102" align="left" valign="top" background="images/back_1.
</tr>
<tr>
<td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="530" height="132" valign="top"><object classid="clsid:D27CDB6E-AE
<param name="movie" value="flash/menu.swf">
<param name="quality" value="high">
<embed src="flash/menu.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockw
</object></td>
<td width="119"><img src="images/top_2.jpg" width="119" height="132"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td width="372" rowspan="3" align="left" valign="top"><p>
<label></label>
<span class="HedingText">Puchase
<p class="style3">To complete the purchase of your product simply fill out the form to the right of this page. Before you do so you should review the details of your purchace below and ensure that you have read the terms and conditions. </p>
<p class="style3">On confirmation of your purchase you will also be presented with a download dialog. Download times are dependant upon the speed of your connection. Should you have any problems simply visit the <a href="support.php">custome
<p>
<?php
echo "Product ID: "."$id"."<br />";
echo "Charge: "."$price"."<br />";
?>
Terms and conditions go here</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
<td width="13" rowspan="3" align="left" valign="top">
<td width="381" height="90" align="left" valign="top"><span class="style5">Please confirm your personal details below
</span>
<p>
<?php
$sql = mysql_query('SELECT * FROM users WHERE username = \''.$uname.'\'');
while($row = mysql_fetch_array($sql))
{
echo "Email: ".$row['email'];
}
?>
<br><form name="form1" method="post" action="<?php echo $PHP_SELF ?>">
<table width="61%" border="0">
<tr>
<td width="23%"> </td>
<td width="24%" class="warninngtxt"><font face="Times New Roman, Times, serif" class="NormalTxt">Firstnam
<td width="46%"> <span class="warninngtxt">
<input name="firstname" type="text" class="textBoxNormal" onFocus="this.className='t
</span></td>
<td width="7%" class="warninngtxt"><?=$er
</tr>
<tr>
<td width="23%"> </td>
<td width="24%" class="warninngtxt"><font face="Times New Roman, Times, serif" class="NormalTxt">Surname<
<td width="46%"> <span class="warninngtxt">
<input name="surname" type="text" class="textBoxNormal" onFocus="this.className='t
</span></td>
<td width="7%" class="warninngtxt"><?=$er
</tr>
<tr>
<td width="23%"> </td>
<td width="24%" class="warninngtxt"><font face="Times New Roman, Times, serif" class="NormalTxt">Date of Birth</font></td>
<td width="46%"> <span class="warninngtxt">
<select name="dob" class="textBoxNormal" id="dob">
<?
for ($i=1; $i<=31; $i++)
{
$s = ($i==(int)$dob) ? " selected=\"selected\"" : "";
$display = ($i<10?"0".$i:$i);
echo "<option value=\"$display\"$s>$disp
}
?>
</select>
<select name="mob" class="textBoxNormal" id="mob">
<?
for ($i=1; $i<=12; $i++)
{
$s = ($i==(int)$mob) ? " selected=\"selected\"" : "";
$display = ($i<10?"0".$i:$i);
echo "<option value=\"$display\"$s>$disp
}
?>
</select>
<input name="yob" type="text" class="textBoxNormal" id="yob" value="<?=$yob?>" size="4" maxlength="4">
</span></td>
<td width="7%" class="warninngtxt"><?=$er
</tr>
<tr>
<td width="23%"> </td>
<td width="24%" class="warninngtxt"><font face="Times New Roman, Times, serif" class="NormalTxt">Street</
<td width="46%"> <span class="warninngtxt">
<input name="street1" type="text" class="textBoxNormal" onFocus="this.className='t
</span></td>
<td width="7%" class="warninngtxt"><?=$er
</tr>
<tr>
<td width="23%"> </td>
<td width="24%" class="warninngtxt"><span class="NormalTxt">Line 2</span> </td>
<td width="46%"> <span class="warninngtxt">
<input name="street2" type="text" class="textBoxNormal" onFocus="this.className='t
</span></td>
<td width="7%" class="warninngtxt"><?=$er
</tr>
<tr>
<td width="23%"> </td>
<td width="24%" class="warninngtxt"><font face="Times New Roman, Times, serif" class="NormalTxt">Town</fo
<td width="46%"> <span class="warninngtxt">
<input name="town" type="text"class="textBoxN
</span></td>
<td width="7%" class="warninngtxt"><?=$er
</tr>
<tr>
<td width="23%"> </td>
<td width="24%" class="warninngtxt"><font
face="Times New Roman, Times, serif" class="NormalTxt">City</fo
<td width="46%"> <span class="warninngtxt">
<input name="city" type="text" class="textBoxNormal" onFocus="this.className='t
</span></td>
<td width="7%" class="warninngtxt"><?=$er
</tr>
<tr>
<td width="23%"> </td>
<td width="24%" class="warninngtxt"><font
face="Times New Roman, Times, serif" class="NormalTxt">Country<
<td width="46%"> <span class="warninngtxt">
<select name="country" size="1" class="textBoxNormal">
<?
$country_array = array ("Ireland","Afganishtan","
//you can get this from your DB.
for ($i=0; $i<count($country_array); $i++)
{
$s = ($country_array[$i]==$coun
echo "<option value=\"".$country_array[$
}
?>
</select>
</span></td>
<td width="7%"> </td>
</tr>
<tr>
<td width="23%"> </td>
<td width="24%" class="warninngtxt"><font face="Times New Roman, Times, serif" class="NormalTxt">Phone</f
<td width="46%"> <span class="warninngtxt">
<input name="phone" type="text" class="textBoxNormal" onFocus="this.className='t
</span></td>
<td width="7%" class="warninngtxt"><?=$er
</tr>
</table>
</p>
<input name="id" id="id" type="hidden" value= "<?php echo "$id"; ?>">
<input name="price" id="price" type="hidden" value= "<?php echo "$price"; ?>"><p>
<label><input type="image" src="images/submit_button.
</form>
</p>
<tr>
<td height="34" align="left" valign="top">
<tr>
<td height="266" align="left" valign="top"> </td>
</tr>
<tr>
<td height="37" colspan="3" align="left" valign="top"><img src="images/line_1.jpg" width="766" height="5"></td>
</tr>
<tr>
<td colspan="3" align="center" valign="top"><div align="center" class="style3" style="padding-top:12px "><a href="index.php" style="color:#6A8BA4 ">About Us </a> &n
<div style="padding-left:0px; padding-top:8px"><a href="index-5.html" class="style3" style="text-decoration:non
</tr>
</table></td>
<td background="images/til_2.j
</tr>
<tr>
<td> </td>
<td width="766" align="left" valign="top"> </td>
<td> </td>
</tr>
</table>
<?php
}
// end if
?>
</body>
</html>
and the page that it is redirecting to is as follows:
<?php
session_start();
$email = $_POST['email'];
$firstname = $_POST['firstname'];
$surname = $_POST['surname'];
$uname = 'TEST';
$id = $_POST['id'];
$dob = $_POST['dob'];
$mob = $_POST['mob'];
$yob = $_POST['yob'];
$street1 = $_POST['street1'];
$street2 = $_POST['street2'];
$town = $_POST['town'];
$city = $_POST['city'];
$country = $_POST['country'];
$C_CcType = $_POST['C_CcType'];
$C_CcNum = $_POST['C_CcNum'];
$C_ExpD = $_POST['C_ExpD'];
$C_Sec = $_POST['C_Sec'];;
?>
<?php echo "$id";?>
<html>
<head>
<title>Secure Payment Screen</title>
<meta http-equiv="Content-Style-
<LINK HREF="style.css" TYPE="text/css" REL="stylesheet">
<style type="text/css">
<!--
#Layer1 {
position:absolute;
left:691px;
top:-7px;
width:0px;
height:29px;
z-index:1;
}
#Layer2 {
position:absolute;
left:702px;
top:5px;
width:101px;
height:28px;
z-index:2;
}
#Layer3 {
position:absolute;
left:130px;
top:252px;
width:278;
height:136;
z-index:2;
background-repeat: no-repeat;
background-image: url(images/bg_register.gif
}
#Layer4 {
position:absolute;
left:129px;
top:463px;
width:350;
height:130;
z-index:3;
}
#Layer5 {
position:absolute;
left:535px;
top:252px;
width:302;
height:202;
z-index:4;
background-image: url(images/bg_product_brow
}
#Layer6 {
position:absolute;
left:506px;
top:463px;
width:332;
height:167;
z-index:5;
background-image: url(images/bg_search.gif);
background-repeat: no-repeat;
}
#Layer7 {
position:absolute;
left:129px;
top:599px;
width:350px;
height:31px;
z-index:6;
background-color: #CCCCCC;
}
#Layer8 {
position:absolute;
left:135px;
top:471px;
width:314;
height:204;
z-index:5;
}
#Layer9 {
position:absolute;
left:130;
top:252;
width:278px;
height:136px;
z-index:2;
background-image: url(images/bg_register.gif
background-repeat:no-repea
}
#Layer10 {
position:absolute;
left:130px;
top:399px;
width:278;
height:136;
z-index:3;
background-image: url(images/bg_register.gif
background-repeat:no-repea
}
#Layer11 {
position:absolute;
left:455px;
top:324px;
width:278;
height:136;
z-index:4;
background-image: url(images/bg_login.jpg);
background-repeat:no-repea
}
-->
</style>
<script type="text/javascript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(p
document.MM_pgW=innerWidth
else if (innerWidth!=document.MM_p
}
MM_reloadPage(true);
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_pre
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&p
d=parent.frames[n.substrin
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;
for(i=0;!x&&d.layers&&i<d.
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arg
if ((x=MM_findObj(a[i]))!=nul
}
//-->
</script>
</head>
<body onLoad="MM_preloadImages('
<div id="Layer1"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/til_2.j
<td width="766" align="left" valign="top"><table width="766" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="left" valign="top">
<td width="541" height="234"><img src="images/top_1.jpg" width="541" height="234"></td>
<td width="225"><table width="225" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="102" align="left" valign="top" background="images/back_1.
</tr>
<tr>
<td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="530" height="132" valign="top"><object classid="clsid:D27CDB6E-AE
<param name="movie" value="flash/menu.swf">
<param name="quality" value="high">
<embed src="flash/menu.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockw
</object></td>
<td width="119"><img src="images/top_2.jpg" width="119" height="132"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td width="372" rowspan="3" align="left" valign="top"><p>
<label></label>
</p>
<p><form name="form1" method="post" action="register1.php">
<p align="center"> </p>
<p align="center" class="style2"><strong>Ple
the following details to complete your order </strong></p>
<p align="center" class="style1 ver11">
<input name="email" type="hidden" id="email" value="<?php echo $email; ?>">
<input name="fname" type="hidden" id="firstname" value="<?php echo $firstname; ?>">
<input name="surname" type="hidden" id="surname" value="<?php echo $surname; ?>">
<input name="dob" type="hidden" id="dob" value="<?php echo $dob; ?>">
<input name="mob" type="hidden" id="mob" value="<?php echo $mob; ?>">
<input name="yob" type="hidden" id="yob" value="<?php echo $yob; ?>">
<input name="street1" type="hidden" id="street1" value="<?php echo $street1; ?>">
<input name="street2" type="hidden" id="street2" value="<?php echo $street2; ?>">
<input name="town" type="hidden" id="town" value="<?php echo $town; ?>">
<input name="city" type="hidden" id="city" value="<?php echo $city; ?>">
<input name="phone" type="hidden" id="phone" value="<?php echo $phone; ?>">
<input name="country" type="hidden" id="country" value="<?php echo $country; ?>">
<input name="id" type="hidden" id="id" value="<?php echo $id; ?>">
</p>
<p align="center" class="style1"><b><font color="#FF0000">Payment Details</font></b></p>
<table width="69%">
<?
if(isset($_GET['payment_er
echo "<TR><TD COLSPAN=2><font color=\"#FF0000\" > &
}
?>
<tr>
<td width="10%" rowspan="4"> </td>
<td width="39%" height="26"><span class="NormalTxt"></span><
Type</span><span class="NormalTxt">:</span>
<td width="51%"> <select name="C_CcType" class="textBoxNormal" id="select2">
<option selected value="1">Visa</option>
<option value="2">MasterCard</opti
<option value="3">American Express</option>
</select> </td>
</tr>
<tr>
<td width="39%" height="24"><span class="NormalTxt">Card Number:</span></td>
<td width="51%"> <input type="text" autocomplete="off" name="C_CcNum" class="textBoxNormal" onFocus="this.className='t
</td>
</tr>
<tr>
<td width="39%" height="42" class="NormalTxt">Expiry Date:</td>
<td width="51%"> <input type="text" name="C_ExpD" autocomplete="off" class="textBoxNormal" onFocus="this.className='t
<span class="NormalTxt">eg: 06/06 </span> </td>
</tr>
<tr>
<td width="39%" height="24" class="NormalTxt">Sec Code:</td>
<td width="51%"> <input type="text" autocomplete="off" name="C_Sec" class="textBoxNormal" onFocus="this.className='t
</td>
</tr>
<tr>
<td height="24" colspan="3"><div align="right">
<input type="image" src="images/submit_button.
</div></td>
</tr>
</table>
<p align="center" class="tahbol style1">
<input name="total" type="hidden" id="total" value="<?php echo $total; ?>">
<input name="p_method" type="hidden" id="p_method" value="<?php echo $p_method; ?>">
</p>
<p> </p>
<p>
</form> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
<td width="394" height="86" align="left" valign="middle"><a href="http://www.pixelscience.it"></a></td>
</tr>
<tr>
<td height="113" align="left" valign="top" class="style3"><div align="center"></div></td>
</tr>
<tr>
<td align="left" valign="top"> </td>
</tr>
<tr>
<td height="37" colspan="2" align="left" valign="top"><img src="images/line_1.jpg" width="766" height="5"></td>
</tr>
<tr>
<td colspan="2" align="center" valign="top"><div align="center" class="style3" style="padding-top:12px "><a href="index.php" style="color:#6A8BA4 ">About Us </a> &n
<div style="padding-left:0px; padding-top:8px"><a href="index-5.html" class="style3" style="text-decoration:non
</tr>
</table></td>
<td background="images/til_2.j
</tr>
<tr>
<td> </td>
<td width="766" align="left" valign="top"> </td>
<td> </td>
</tr>
</table>
<?php
// end if
?>
</body>
</html>
The problem im having is with the $id isnt passing from the purchase2.php page to the payment page and i cant figure put why as all the other values are passing over no problems.
Apologies for the mass of code, Ive only posted all of it due to the fact that the forms are using hidden fields and are all part of the problem here i think.... is $id ok to use or is it reserved or anything?
ASKER
yes, i have it in there towards the bottom of the form:
<input type="hidden" name="id" value="<?php echo htmlspecialchars($id);?>"/ >
<input name="price" id="price" type="hidden" value= "<?php echo "$price"; ?>"><p>
<label><input type="image" src="images/submit_button. jpg" align="absmiddle" border="0" name="submit"></label>
</form>
ive just tried adding on your htmlspecialchars code also but no luck there :(
<input type="hidden" name="id" value="<?php echo htmlspecialchars($id);?>"/
<input name="price" id="price" type="hidden" value= "<?php echo "$price"; ?>"><p>
<label><input type="image" src="images/submit_button.
</form>
ive just tried adding on your htmlspecialchars code also but no luck there :(
Do you see the id when doing view source from your browser on the first page?
-r-
-r-
ASKER
on purchase 2.php yes the value does display.... thats why i find this strange. is it something to do with the fact that im applying a javascript redirect in the code or should that effect things at all?
I dont beleive the redirect is going to carry with it any post information. You could try appending the $id to the URL and use $_GET or $_REQUEST to retrieve it.....or write it to a session and retrieve it via $_SESSION and when all done destroy the session.
ASKER
>>>> I dont beleive the redirect is going to carry with it any post information. You could try appending the $id to the URL and use $_GET or $_REQUEST to retrieve it.....or write it to a session and retrieve it via $_SESSION and when all done destroy the session.
How would I code such a thing with a $_session and at what point should it be destroyed?
How would I code such a thing with a $_session and at what point should it be destroyed?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
worked great,
thanks!
thanks!
Have you tried adding a hidden input?
<form name="form1" method="post" action="<?php echo $PHP_SELF ?>">
<input type="hidden" name="id" value="<?php echo htmlspecialchars($id);?>"/
-r-