值是可以的 但是当我结帐哪个去checkout.php文件时,值不会从我输入的内容中获取managecart.php
下面是我为该页面创建的编码(checkout.php),但现在它似乎无法正常工作。
<?
session_start();
?>
<?
$strMessageBody .= "$QUANTITY_1 - \$$PRICE_1 - $NAME_1 <br>";
if( $NAME_2 ) {$strMessageBody .= "$QUANTITY_2 - \$$PRICE_2 - $NAME_2 <br>";}
if( $NAME_3 ) {$strMessageBody .= "$QUANTITY_3 - \$$PRICE_3 - $NAME_3 <br>";}
if( $NAME_4 ) {$strMessageBody .= "$QUANTITY_4 - \$$PRICE_4 - $NAME_4 <br>";}
if( $NAME_5 ) {$strMessageBody .= "$QUANTITY_5 - \$$PRICE_5 - $NAME_5 <br>";}
if( $NAME_6 ) {$strMessageBody .= "$QUANTITY_6 - \$$PRICE_6 - $NAME_6 <br>";}
if( $NAME_7 ) {$strMessageBody .= "$QUANTITY_7 - \$$PRICE_7 - $NAME_7 <br>";}
if( $NAME_8 ) {$strMessageBody .= "$QUANTITY_8 - \$$PRICE_8 - $NAME_8 <br>";}
if( $NAME_9 ) {$strMessageBody .= "$QUANTITY_9 - \$$PRICE_9 - $NAME_9 <br>";}
if( $NAME_10 ){$strMessageBody .= "$QUANTITY_10 - \$$PRICE_10 - $NAME_10 <br>";}
if( $NAME_11 ){$strMessageBody .= "$QUANTITY_11 - \$$PRICE_11 - $NAME_11 <br>";}
if( $NAME_12 ){$strMessageBody .= "$QUANTITY_12 - \$$PRICE_12 - $NAME_12 <br>";}
if( $NAME_13 ){$strMessageBody .= "$QUANTITY_13 - \$$PRICE_13 - $NAME_13 <br>";}
if( $NAME_14 ){$strMessageBody .= "$QUANTITY_14 - \$$PRICE_14 - $NAME_14 <br>";}
if( $NAME_15 ){$strMessageBody .= "$QUANTITY_15 - \$$PRICE_15 - $NAME_15 <br>";}
if( $NAME_16 ){$strMessageBody .= "$QUANTITY_16 - \$$PRICE_16 - $NAME_16 <br>";}
if( $NAME_17 ){$strMessageBody .= "$QUANTITY_17 - \$$PRICE_17 - $NAME_17 <br>";}
if( $NAME_18 ){$strMessageBody .= "$QUANTITY_18 - \$$PRICE_18 - $NAME_18 <br>";}
if( $NAME_19 ){$strMessageBody .= "$QUANTITY_19 - \$$PRICE_19 - $NAME_19 <br>";}
if( $NAME_20 ){$strMessageBody .= "$QUANTITY_20 - \$$PRICE_20 - $NAME_20 <br>";}
if( $NAME_21 ){$strMessageBody .= "$QUANTITY_21 - \$$PRICE_21 - $NAME_21 <br>";}
if( $NAME_22 ){$strMessageBody .= "$QUANTITY_22 - \$$PRICE_22 - $NAME_22 <br>";}
if( $NAME_23 ){$strMessageBody .= "$QUANTITY_23 - \$$PRICE_23 - $NAME_23 <br>";}
if( $NAME_24 ){$strMessageBody .= "$QUANTITY_24 - \$$PRICE_24 - $NAME_24 <br>";}
if( $NAME_25 ){$strMessageBody .= "$QUANTITY_25 - \$$PRICE_25 - $NAME_25 <br>";}
if( $NAME_26 ){$strMessageBody .= "$QUANTITY_26 - \$$PRICE_26 - $NAME_26 <br>";}
if( $NAME_27 ){$strMessageBody .= "$QUANTITY_27 - \$$PRICE_27 - $NAME_27 <br>";}
if( $NAME_28 ){$strMessageBody .= "$QUANTITY_28 - \$$PRICE_28 - $NAME_28 <br>";}
$wcart = $strMessageBody;
$strMessageBody2 .= "$TOTAL";
$wcart = $strMessageBody;
$wtotal = $strMessageBody2;
?>
我觉得数据丢失了哪些想法?
下面的managecart.php页面
<?
session_start();
include("includes/db.php");
include("includes/phpscripts.php");
include('includes/settings.php');
if($_GET["action"] == "addcat")
{
$GETCATNAME = str_replace("'","''",$_REQUEST['CATNAME']);
$dbh=mysql_connect ("localhost", "florida_fields", "fields321") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("florida_fields");
$query = "INSERT INTO SHOPCAT VALUES ('','$GETCATNAME','0')";
mysql_query($query);
}
if($_GET["action"] == "editcat")
{
$GETCATNAME2 = str_replace("'","''",$_REQUEST['CATNAME2']);
$GETSHOPCAT2 = str_replace("'","''",$_REQUEST['SHOPID2']);
$GETSOLDOUT2 = str_replace("'","''",$_REQUEST['SOLDOUT2']);
$dbh=mysql_connect ("localhost", "florida_fields", "fields321") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("florida_fields");
$query = "UPDATE SHOPCAT SET CATNAME = '$GETCATNAME2', SOLDOUT = '$GETSOLDOUT2' WHERE SHOPID = '$GETSHOPCAT2'";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
}
if($_GET["action"] == "saveproduct")
{
$SAVEPID = str_replace("'","''",$_REQUEST['PID']);
unset($imagename);
if(!isset($_FILES) && isset($HTTP_POST_FILES))
$_FILES = $HTTP_POST_FILES;
if(!isset($_FILES['image_file']))
$error["image_file"] = "An image was not found.";
$newphrase = $SAVEPID.".jpg";
$imagename = str_replace(" ", "-", $newphrase);
if(empty($imagename))
$error["imagename"] = "The name of the image was not found.";
if(empty($error))
{
$newimage = $imagename;
if(basename($_FILES['image_file']['name']) == "")
{
}
else
{
$result = @move_uploaded_file($_FILES['image_file']['tmp_name'], $newimage);
if(empty($result))
$error["result"] = "There was an error moving the uploaded file.";
$source = $imagename;
$target = "products/$source";
$width = 200;
$height = 133;
$quality = 100;
$size = getimagesize($source);
//scale evenly
$ratio = $size[0] / $size[1];
if ($ratio >= 1){
$scale = $width / $size[0];
} else {
$scale = $height / $size[1];
}
// make sure its not smaller to begin with!
if ($width >= $size[0] && $height >= $size[1]){
$scale = 1;
}
$im_in = imagecreatefromjpeg ($source);
$im_out = imagecreatetruecolor($size[0] * $scale, $size[1] * $scale);
imagecopyresampled($im_out, $im_in, 0, 0, 0, 0, $size[0] * $scale, $size[1] * $scale, $size[0], $size[1]);
imagejpeg($im_out, $target, $quality);
imagedestroy($im_out);
imagedestroy($im_in);
$result = @move_uploaded_file($_FILES['image_file']['tmp_name'], $newimage);
if(empty($result))
$error["result"] = "There was an error moving the uploaded file.";
$source = $imagename;
$target = "products/large/$source";
$width = 600;
$height = 400;
$quality = 100;
$size = getimagesize($source);
//scale evenly
$ratio = $size[0] / $size[1];
if ($ratio >= 1){
$scale = $width / $size[0];
} else {
$scale = $height / $size[1];
}
// make sure its not smaller to begin with!
if ($width >= $size[0] && $height >= $size[1]){
$scale = 1;
}
$im_in = imagecreatefromjpeg ($source);
$im_out = imagecreatetruecolor($size[0] * $scale, $size[1] * $scale);
imagecopyresampled($im_out, $im_in, 0, 0, 0, 0, $size[0] * $scale, $size[1] * $scale, $size[0], $size[1]);
imagejpeg($im_out, $target, $quality);
imagedestroy($im_out);
imagedestroy($im_in);
}
}
$DelFile = $imagename;
if(basename($_FILES['image_file']['name']) == "")
echo "";
else
unlink($DelFile);
$SAVEPNAME = str_replace("'","''",$_REQUEST['PNAME']);
$SAVEPTEXT = str_replace("'","''",$_REQUEST['PTEXT']);
$SAVEPPRICE = str_replace("'","''",$_REQUEST['PPRICE']);
$SAVEPID = str_replace("'","''",$_REQUEST['PID']);
$dbh=mysql_connect ("localhost", "florida_fields", "fields321") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("florida_fields");
if(basename($_FILES['image_file']['name']) == "")
{
$query = "UPDATE SHOPPRODUCTS SET PNAME = '$SAVEPNAME', PTEXT = '$SAVEPTEXT', PPRICE = '$SAVEPPRICE' WHERE PID = '$SAVEPID'";
}
else
{
$query = "UPDATE SHOPPRODUCTS SET PNAME = '$SAVEPNAME', PTEXT = '$SAVEPTEXT', PPRICE = '$SAVEPPRICE', PIMAGE ='1' WHERE PID = '$SAVEPID'";
}
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
}
if($_GET["action"] == "addproduct")
{
$GETPNAME = str_replace("'","''",$_REQUEST['PNAME']);
$GETPTEXT = str_replace("'","''",$_REQUEST['PTEXT']);
$GETPPRICE = str_replace("'","''",$_REQUEST['PPRICE']);
$GETPCAT = str_replace("'","''",$_REQUEST['PCAT']);
$dbh=mysql_connect ("localhost", "florida_fields", "fields321") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("florida_fields");
$query = "INSERT INTO SHOPPRODUCTS VALUES ('','$GETPNAME','$GETPTEXT','$GETPPRICE','$GETPCAT','0')";
mysql_query($query);
}
if($_GET["action"] == "editcat")
{
$GETCATNAME2 = str_replace("'","''",$_REQUEST['CATNAME2']);
$GETSHOPCAT2 = str_replace("'","''",$_REQUEST['SHOPID2']);
$GETSOLDOUT2 = str_replace("'","''",$_REQUEST['SOLDOUT2']);
$dbh=mysql_connect ("localhost", "florida_fields", "fields321") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("florida_fields");
$query = "UPDATE SHOPCAT SET CATNAME = '$GETCATNAME2', SOLDOUT = '$GETSOLDOUT2' WHERE SHOPID = '$GETSHOPCAT2'";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
}
?>
<?
if($_GET["action"] == "deleteshopcat")
{
$dbh=mysql_connect ("localhost", "florida_fields", "fields321") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("florida_fields");
$TID = $_REQUEST['DID'] ;
$sql = "DELETE FROM SHOPCAT WHERE SHOPID = '$TID'";
mysql_query($sql);
//mysql_close();
}
?>
<?
if($_GET["action"] == "deleteproduct")
{
$dbh=mysql_connect ("localhost", "florida_fields", "fields321") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("florida_fields");
$TID = $_REQUEST['DID'] ;
$sql = "DELETE FROM SHOPPRODUCTS WHERE PID = '$TID'";
mysql_query($sql);
//mysql_close();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?echo$SHOWTITLE?></title>
<meta name="description" content="<?echo$SHOWDESC?>" />
<meta name="keywords" content="<?echo$SHOWKEYS?>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/menu.css" rel="stylesheet" type="text/css" />
<SCRIPT SRC="language-en.js"></SCRIPT>
<SCRIPT SRC="nopcart.js"></SCRIPT>
<script>
function Edit(id)
{
window.open("editor/examples/editor1.php?ID="+id,"test","toolbar=no,location=no,status=no,resizable=yes,scrollbars=auto,width=700,height=600,top=50,left=50");
}
</script>
<script language="JavaScript">
<!--
function Form1()
{
if(document.form2.NAME.value=="")
{
alert("Please Enter Page Name");
return false;
}
}
function Form2()
{
if(document.form3.SUBONENAME.value=="")
{
alert("Please Enter Sub Page Name");
return false;
}
}
function Form3()
{
if(document.form4.SUBTWONAME.value=="")
{
alert("Please Enter Sub Page Name");
return false;
}
}
//-->
</script>
<script>
function DeletePage(id)
{
if(confirm("Are you really really sure you want to delete this page?"))
{
if(confirm("Ok, don't tell me I didn't warn you! You can not undo this one you know?"))
{
parent.location="index.php?action=delete&DID="+id
}
}
}
</script>
<script>
function DeleteProd(id)
{
if(confirm("Are you really really sure you want to delete this product?"))
{
if(confirm("Ok, don't tell me I didn't warn you! You can not undo this one you know?"))
{
parent.location="index.php?ID=49&action=deleteproduct&DID="+id
}
}
}
</script>
<script>
function DeleteShopCat(id)
{
if(confirm("Are you really really sure you want to delete this catagoy?"))
{
if(confirm("Ok, don't tell me I didn't warn you! You can not undo this one you know?"))
{
parent.location="index.php?ID=49&action=deleteshopcat&DID="+id
}
}
}
</script>
<script>
function showit(it) {
document.getElementById(it).style.display = "block";
}
function hideit(it) {
document.getElementById(it).style.display = "none";
}
function hideall() {
for (var i=1; i<=2; i++) {
hideit("x" + i);
}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;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_preloadImages.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&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; 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.length;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.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
<style type="text/css">
<!--
body {
background-image: url(back.jpg);
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<link href="css/florida.css" rel="stylesheet" type="text/css" />
</head>
<body onload="MM_preloadImages('images/button1_2.jpg','images/button2_2.jpg')">
<table width="1024" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top" background="mainback.jpg"><table width="944" height="717" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="109"><div align="right"><a href="https://www.facebook.com/Grassfedmalabar"><img src="images/facebook.jpg" width="310" height="50" border="0" /></a><br />
<a href="memberlogin.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image4','','images/button1_2.jpg',1)"><img src="images/button1_1.jpg" name="Image4" border="0" id="Image4" /></a><img src="images/button2.jpg" width="32" height="59" /><a href="join.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image6','','images/button2_2.jpg',1)"><img src="images/button2_1.jpg" name="Image6" width="129" height="59" border="0" id="Image6" /></a></div></td>
</tr>
<tr>
<td height="159">
</td>
</tr>
<tr>
<td valign="top"><table width="941" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"> </td>
<td valign="top" class="TextD"><br /> </td>
</tr>
<tr>
<td width="156" valign="top"><table width="155" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/menuback.jpg"><br />
<table width="156" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="28"> </td>
<td width="128" valign="top"><? include("menu.php");?>
<br />
<br /></td>
</tr>
</table>
<div align="left"><img src="images/menubottom.jpg" width="149" height="69" /><br />
</tr>
</table>
<?php
if ($_SESSION['florida']=='fields321')
{
?>
<div align="left">
<span class="link2"> • <a href="addpage.php">Edit Menu</a></span><br />
<span class="link2"> • <a href="index.php?action=logout">Logout</a></span><br />
<span class="link2"> • <a href="pagesettings.php">Page Settings</a></span><br />
<span class="link2"> • <a href="sortmenu.php">Sort Menu</a></span><br />
<span class="link2"> • <a href="members.php">Members</a></span><br />
<span class="link2"> • <a href="checkorders.php">Orders</a></span><br />
<span class="link2"> • <a href="addcat.php">Edit Gallery</a></span><br />
</div>
<?
}
?>
<span class="link2"> • <a href="index.php?ID=49">Shop The Farm</a></span><br />
</td>
<td width="779" valign="top"><span class="TextB"><strong>SHOPPING CART</strong></span><br />
<br />
<span class="TextB">Members are responsible for all paypal fees. The fee will be listed on your invoice as shipping.</span> <br />
<br />
<FORM ACTION="checkout.php" NAME="form" METHOD="POST" onSubmit="return ValidateCart(this)">
<div align="left">
<script>
ManageCart();
</script>
<input type=IMAGE src="images/placeorder.jpg" alt="Place Order" border=0 /> <a href="index.php?ID=49"><img src="images/returntocart.jpg" border="0"/></a>
</div>
</FORM><br /></td>
</tr>
</table></td>
</tr>
</table>
<br /></td>
</tr>
<tr>
<td align="center"> </td>
</tr>
</table>
</body>
</html>