Avatar billede farhang Nybegynder
17. oktober 2006 - 16:44 Der er 9 kommentarer og
1 løsning

Hvid skærm kun i IE-browser!

Jeg har problem med at se mine echo's i IE, er der nogen, som kender til en årsag?

Man kommer fra trin 2 via kollektion.php > cart.php > checkout1.php > checkout2.php > så til checkout3.php klik her http://www.designunltd.dk/la-femme/kollektion.php

<?php
session_start();
?>
<?php
//connect to the database - either include a connection variable file
//or type the following lines:
$connect = mysql_connect("xxxxx", "xxxxx", "xxxxx")
  or die ("Hey loser, check your server connection.");
mysql_select_db("designunltddk_shop");

//Let's make the variables easy to access in our queries
$fornavn = $_POST['fornavn'];
$efternavn = $_POST['efternavn'];
$adresse1 = $_POST['adresse1'];
$adresse2 = $_POST['adresse2'];
$by = $_POST['by'];
$postnr = $_POST['postnr'];
$telefon = $_POST['telefon'];
$mobil = $_POST['mobil'];
$email = $_POST['email'];
$shipfornavn = $_POST['shipfornavn'];
$shipefternavn = $_POST['shipefternavn'];
$shipadresse1 = $_POST['shipadresse1'];
$shipadresse2 = $_POST['shipadresse2'];
$shipby = $_POST['shipby'];
$shippostnr = $_POST['shippostnr'];
$shiptelefon = $_POST['shiptelefon'];
$shipmobil = $_POST['shipmobil'];
$shipemail = $_POST['shipemail'];
$total = $_POST['total'];
$sessid = session_id();
$today = date("d/m/Y - H:i");

//1) Assign Customer Number to new Customer, or find existing customer number
$query = "SELECT * FROM kunder WHERE
          (kunde_fornavn = '$fornavn' AND
          kunde_efternavn = '$efternavn' AND
          kunde_adresse1 = '$adresse1' AND
          kunde_adresse2 = '$adresse2' AND
          kunde_by = '$by')";
$results = mysql_query($query)
  or (mysql_error());
$rows = mysql_num_rows($results);

if ($rows < 1) {
  //assign new custnum
  $query2 = "INSERT INTO kunder (
            kunde_fornavn, kunde_efternavn, kunde_adresse1,
            kunde_adresse2, kunde_by,
            kunde_postnr, kunde_telefon, kunde_mobil,
            kunde_email)
            VALUES (
            '$fornavn',
            '$efternavn',
            '$adresse1',
            '$adresse2',
            '$by',
            '$postnr',
            '$telefon',
            '$mobil',
            '$email')";
  $insert = mysql_query($query2)
    or (mysql_error());
  $custid = mysql_insert_id();
}

//If custid exists, we want to make it equal to custnum
//Otherwise we will use the existing custnum
if ($custid) {
  $kunde_custnum = $custid;
}

//2) Insert Info into ordermain
//determine shipping costs based on order total (25% of total)
$fragt = 35;

$query3 = "INSERT INTO ordermain (
          ordermain_orderdato, ordermain_custnum,
          ordermain_subtotal, ordermain_fragt,
          ordermain_fragtfornavn, ordermain_fragtefternavn,
          ordermain_fragtadresse1, ordermain_fragtadresse2,
          ordermain_fragtby,
          ordermain_fragtpostnr, ordermain_fragttelefon,
          ordermain_fragtemail)
          VALUES (
          '$today',
          '$kunde_custnum',
          '$total',
          '$fragt',
          '$shipfornavn',
          '$shipefternavn',
          '$shipadresse1',
          '$shipadresse2',
          '$shipby',
          '$shippostnr',
          '$shiptelefon',
          '$shipemail')";
$insert2 = mysql_query($query3)
  or (mysql_error());
$orderid = mysql_insert_id();

//3) Insert Info into orderdet
//find the correct cart information being temporarily stored
$query = "SELECT * FROM carttemp WHERE carttemp_sess='$sessid'";
$results = mysql_query($query)
  or (mysql_error());

//put the data into the database one row at a time
while ($row = mysql_fetch_array($results)) {
  extract($row);
  $query4 = "INSERT INTO orderdet (
            orderdet_ordernum, orderdet_qty, orderdet_prodnum)
            VALUES (
            '$orderid',
            '$carttemp_quan',
            '$carttemp_prodnum')";
  $insert4 = mysql_query($query4)
    or (mysql_error());
}

//4)delete from temporary table
$query = "DELETE FROM carttemp WHERE carttemp_sess='$sessid'";
$delete = mysql_query($query);

echo "<html>
    <head>"; ?>
<?php
echo "<title>La-femme.dk - Ordrebekræftelse trin 3 af 3/title>";
?>
<?php include("includes/topinclude.php") ?>
<?php
$queryvenstrebillede = "SELECT billede_id FROM billeder WHERE billede_id = '6'";
$results = mysql_query($queryvenstrebillede)
  or die(mysql_error());
$row = mysql_fetch_array($results);

echo "<td width=\"385\" height=\"472\" valign=\"top\" align=\"right\">";
echo "<img src=\"images/";
echo $row['billede_id'] . ".jpg\" width=\"385\" height=\"451\" border=\"0\">";
echo "</td>";
echo "<td width=\"15\" height=\"472\"></td>";
echo "<td width=\"385\" height=\"472\" class=\"indhold\" valign=\"top\" align=\"right\">";
?>
<?
echo "<table width=\"385\" border=\"0\">
    <tr>";
echo "<td width=\"385\" border=\"0\" class=\"indhold\"  align=\"right\">";
echo "Tak for din ordre.";
echo "</td>
    </tr>";
echo "<tr>";
echo "<td width=\"385\" border=\"0\" class=\"indhold\"  align=\"right\">";
echo "<div align=\"right\">Ordre dato: ";
echo $today;
echo "<br>
    Ordre nummer: ";
echo $orderid;
echo "<br><br></div>";
echo "</td>
    </tr>";
echo "</table>
<table width=\"385\" border=\"0\">
      <tr>
        <td width=\"50%\" class=\"indhold\">
        Faktureres til:<br><br>";
echo $fornavn;
echo " ";
echo $efternavn;
echo "<br>";
echo  $adresse1;
echo "<br>";
  if ($adresse2) {
echo  $adresse2 . "<br>";
  }
echo  $postnr . " " . $by . "";
echo  "<br></td>
    <td width=\"50%\" class=\"indhold\">
      Sendes til:<br><br>";
echo  $shipfornavn . " " . $shipefternavn;
echo "<br>";
echo  $shipadresse1 . "<br>";
  if ($shipadresse2) {
echo  $shipadresse2 . "<br>";
  }
echo $shippostnr . " " . $shipby;
echo "<br>
        </td>
      </tr>
    </table>
    <table width=\"385\" cellpadding=\"5\">";
echo "<tr><td width=\"5%\" class=\"indhold\">";
echo "<b>Antal</b>";
echo "</td>";
echo "<td width=\"45%\" class=\"indhold\">";
echo "<b>Produkt</b>";
echo "</td>";
echo "<td width=\"25%\" class=\"indhold\" align=\"right\">";
echo "<b>Pris</b>";
echo  "</td>";
echo "<td width=\"25%\" class=\"indhold\" align=\"right\">";
echo "<b><div align=\"right\"> Pris i alt</div></b>";
echo "</td>";
echo "</tr>";

$query = "SELECT * FROM orderdet WHERE orderdet_ordernum = '$orderid'";
$results = mysql_query($query)
  or die (mysql_query());
while ($row = mysql_fetch_array($results)) {
  extract($row);
  $prod = "SELECT * FROM products
          WHERE products_prodnum = '$orderdet_prodnum'";
  $prod2 = mysql_query($prod);
  $prod3 = mysql_fetch_array($prod2);
  extract($prod3);
echo "<tr><td class=\"indhold\">";
echo $orderdet_qty;
echo "</td>";
echo "<td class=\"indhold\">";
echo  $products_navn;
echo "</td>";
echo "<td class=\"indhold\" align=\"right\">";
echo $products_pris;
echo  "</td>";
echo "<td class=\"indhold\" align=\"right\"><div align=\"right\">";
  //get extended price
  $extprice = $products_pris * $carttemp_qty;
  $extprice = number_format($products_pris * $orderdet_qty, 2, ',' , '.');
echo $extprice;
echo "</div></td>";
echo "</tr>";
}

echo  "<tr>
    <td class=\"indhold\" colspan=\"3\" align=\"right\">
      Pris i alt(incl. moms):
    </td>
    <td width=\"50%\" class=\"indhold\" colspan=\"2\" align=\"right\"><div align=\"right\">";
echo  number_format($total, 2, ',' , '.');
echo  "</div></td>
    </tr>
    <tr>
      <td class=\"indhold\" colspan=\"3\" align=\"right\">
        Forsendelse:
      </td>
      <td width=\"50%\" class=\"indhold\" colspan=\"2\" align=\"right\"><div align=\"right\">";
echo  number_format($fragt, 2, ',' , '.');
echo  "</div></td>
    </tr>
    <tr>
      <td class=\"indhold\" colspan=\"3\" align=\"right\">
        Beløbet i alt:
      </td>
      <td width=\"50%\" class=\"indhold\" colspan=\"2\" align=\"right\"><b><div align=\"right\">";
echo number_format(($total + $fragt), 2, ',' , '.');
echo "</b></div>
        </td>
      </tr>
    </table>";
?>
<?php include("includes/bundstregcheck3include.php") ?>
<?php include("menu/checkout3menu.php") ?>
<?php include("includes/bundinclude.php") ?>
Avatar billede jakobdo Ekspert
17. oktober 2006 - 18:03 #1
I firefox kommer jeg fint fra step2 -> step3.
Men er det kun IE du mener?
Avatar billede farhang Nybegynder
17. oktober 2006 - 19:08 #2
Ja, det er kun IE, som ikke virker.
Avatar billede jakobdo Ekspert
18. oktober 2006 - 08:06 #3
Man kan se den kalder checkoutmail.php, og derefter hoppre den til checkout3.php
Det kunne ikke tænkes der er nogle variabler som ikke er sat som ønsket?
Prøv i toppen af checkout3.php at lav:

echo '<pre>';
print_r($_SESSION);
echo '</pre>';

echo '<pre>';
print_r($_POST);
echo '</pre>';

echo '<pre>';
print_r($_GET);
echo '</pre>';

exit();

Indeholder de de rigtige data?
Avatar billede farhang Nybegynder
18. oktober 2006 - 10:00 #4
Jeg får følgende echo, når jeg indsætter din kode:

Array
(
)

Array
(
)

Hvad betyder det?
Avatar billede jakobdo Ekspert
18. oktober 2006 - 20:03 #5
Du skulle da meget gerne få 3?
Avatar billede farhang Nybegynder
19. oktober 2006 - 10:53 #6
Avatar billede jakobdo Ekspert
19. oktober 2006 - 17:10 #7
Jeg fik nu følgende fejl:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, farhang@email.dk and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Apache Server at www.designunltd.dk Port 80
Avatar billede farhang Nybegynder
29. november 2006 - 15:16 #8
Tak for hjælpen. Smid et svar.
Avatar billede jakobdo Ekspert
29. november 2006 - 16:11 #9
Svar!
Avatar billede jakobdo Ekspert
29. november 2006 - 16:58 #10
Takker for point.
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester