jeg prøver at lave en onlineshop via golive men når man trykker
på send for at sende ordren så melder den fejl. jeg er newbie.
denne fejl kommer: Error by using this shop. ID is invalid.
denne er en af koderne i det.. tror det er i denne fejlen er. Den
skulle gemme det i en mappe der hedder orders som man så kan
hente ned. men virker som sagt ikk.
dette er koden::
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type"
content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive">
<title>Thanks</title>
</head>
<body bgcolor="#e6e6fa">
<?php
include("shopfunctions.php");
//Get userdata from "POST"-form
$userarr = $HTTP_POST_VARS;
$salu = $userarr["salutation"];
$fina = $userarr["firstname"];
$name = $userarr["name"];
$stre = $userarr["street"];
$numb = $userarr["number"];
$area = $userarr["area"];
$stat = $userarr["state"];
$city = $userarr["city"];
$coun = $userarr["country"];
$mail = $userarr["mail"];
$paym = $userarr["payment"];
$id = $userarr["id"];
$tota = $userarr["total"];
$curr = $userarr["currency"];
//Get orderdata from tempfile
$file = "Data/".$id.".txt";
$orderfile = @Open($file);
$orderlist = explode("-**-", $orderfile);
if(!$orderfile)
{die("Error by using this shop. ID is invalid.");}
for($i = 0; $i<count($orderlist); $i++)
{
$orderstr = $orderlist[$i];
$orderarr = explode("*@*", $orderstr);
$onetosave[] = $orderarr[1]."(".$orderarr[2].")
quantity: ".$orderarr[12]." single amount: ".$orderarr[3]
."sum: ".($orderarr[3]*$orderarr[12]);
}
$ordertosave = implode("\n\n", $onetosave);
$time = date("F j, Y, g:i a");
$usertosave = $salu." ".$fina." ".$name."\n".$stre."
".$numb."\n".$area."
".$city."\n".$stat."\n".$coun."\n".$mail."\n".$paym."\n";
$tosave =
$time."------CUSTOMER------\n".$usertosave."\n------ORDER------\n
".$ordertosave."\nTOTAL: ".$tota." ".$curr;
//Is e-mail to send?
$filename="Orders/MailAddress.txt";
$mail = @Open($filename);
if(isset($mail) && $mail !="")
{
$address =$mail;
$send = mail($address,"New order",$tosave);
}
//save orders
$savefile = "Orders/".$name.$id.".txt";
@OpenNew($savefile, $tosave);
//destroy waste
unlink($file);
$temp = @GetFolderList("Data/");
@DeleteFile("Data/", $temp);
?>
<table width="80%" border="0" cellspacing="0" cellpadding="0"
align="center">
<tr>
<td colspan="4" bgcolor="#191970"><br>
<div align="center">
<h2><font color="#e6e6fa"
face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">Thanks</font>
</h2>
</div>
</td>
</tr>
<tr height="15">
<td bgcolor="#e6e6fa" width="20%" height="15"></td>
<td bgcolor="#e6e6fa" height="15"></td>
<td bgcolor="#e6e6fa" height="15"></td>
<td bgcolor="#e6e6fa" width="20%" height="15"></td>
</tr>
<tr>
<td bgcolor="#e6e6fa" width="20%"></td>
<td colspan="2" bgcolor="#e6e6fa"><font
face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"><? echo
$salu." ".$name.",<br>" ?>thank you for buying our products.
We'll deliver the ware to following address:</font></td>
<td bgcolor="#e6e6fa" width="20%"></td>
</tr>
<tr>
<td bgcolor="#e6e6fa" width="20%"></td>
<td bgcolor="#e6e6fa"><font
face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">
<br>
<?echo $fina." ".$name; ?><br>
<?echo $stre." ".$numb; ?><br>
<?echo $area." ".$city; ?><br></font></td>
<td bgcolor="#e6e6fa"></td>
<td bgcolor="#e6e6fa" width="20%"></td>
</tr>
<tr>
<td bgcolor="#e6e6fa" width="20%"></td>
<td bgcolor="#e6e6fa"></td>
<td bgcolor="#e6e6fa"></td>
<td bgcolor="#e6e6fa" width="20%"><a
href="Productgroups.php"><font
face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">back</font></
a></td>
</tr>
</table>
<p></p>
</body>
</html>
Nogen ideer til hvad fejlen kan være eller hvad fil den ellers
kunne være i
--
Vil du lære at kode HTML, XHTML, CSS, SSI, ASP eller ASP.NET?
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! =>
http://www.html.dk/tutorials