/ Forside / Teknologi / Udvikling / PHP / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
PHP
#NavnPoint
rfh 3959
natmaden 3372
poul_from 3310
funbreak 2700
stone47 2230
Jin2k 1960
Angband 1743
Bjerner 1249
refi 1185
10  Interkril.. 1146
Hjælp til onlineshop sende formular
Fra : Kasper Pedersen


Dato : 07-12-06 20:29

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

 
 
Kasper Pedersen (07-12-2006)
Kommentar
Fra : Kasper Pedersen


Dato : 07-12-06 22:57

Vil lige tilføje at siden kan findes på

http://kasper.team-alcohol.com/Productgroups.php

fejlen skrives her:

http://kasper.team-alcohol.com/Thanks.php

håber nogen kan hjælpe

--
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

Søg
Reklame
Statistik
Spørgsmål : 177552
Tips : 31968
Nyheder : 719565
Indlæg : 6408849
Brugere : 218887

Månedens bedste
Årets bedste
Sidste års bedste