SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Feb 2004
    Location
    Oregon
    Posts
    686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    page needs refreshed to work

    this is a strange one as it only happens in IE.

    the scenerio is I send variables to a popup. this then loads them into a db and refreshes to another pages to view them, kind of like a shopping cart.

    now, you say it is because of the popup, well no, I have ran the script in it's own window. samething. what happens is that the popup comes up, the page loads, well it seems to load, but doesn't run anything. just a blank white page with the url in the title instead of the regular title. if you click refresh it then loads like it is suppose to and then redirects to the normal page.

    now this is the weird part. it does it on add, like I have said, then if you just view the cart, it does it sometimes. if you delete a item from the cart it does it. I thought it was because of the meta tag refresh I was using, so I changed them to header redirect, samething.

    I am almost at a loss. the script works 100%, but the browser is not sending something to it to do make it run. so it is not the script itself. but in case I will add the "add" function here. if you look, it doesn't even add anything to the db when it does this. upon refresh it gets added. so it is not the redirect.

    and remember, this only happens to IE on w2k and XP.
    PHP Code:
    if ($_GET['action'] == "add"){
        
    $item = array();
        
    $db_ADD->connect();
        if (
    $_GET["ext"]){
            
    $ext "mp_";
        }
        
    $db_ADD->query("select * from {$ext}shopping where custID = '{$GLOBALS["sessionhash"]}' ");
       if(
    $how_many $db_ADD->num_rows($db_ADD->Query_ID)){
           while (
    $row $db_ADD->fetch($db_ADD->Query_ID)){
               
    $param "prod_qty[{$row['prodID']}]";
               
    setcookie($param,$how_manytime() + 60*60*3"/");
               if(
    $_GET["prodid"] == $row["prodID"] AND $ext){
                   echo
    "<META HTTP-EQUIV=\"Refresh\" Content=\"0;URL=cart_pop.php?action=viewcart&amp;ext=mp_\">\n";
                  exit;
               } else{
                    
    $item[] = $row["prodID"];
               }
            }
       }
       
    //echo $pactid;
        //$timenow2 = date("G:i");


      
    if($how_many $getsetting['Cart Limit']){
           echo
    "<table cellspacing=\"0\" width=\"100%\" height=\"100%\" cellpadding=\"0\" border=\"0\" align=\"center\" valign=\"middle\"><tr><td align=\"center\">\n";
           echo
    "<span style=\"font-face:Verdana; font-size:12px; color: #000000\"><b>I am sorry, you are only allowed 10 Products at one time.</p>\n";
           echo
    "<br />Either download what you have already or delete some, thank you.<br /><p>\n";
           echo
    "<p>Click <a href=\"javascript:history.back(1)\"><span style=\"font-face:Verdana; font-size:12px;\">HERE</a> to go back.</b></span></td></tr></table>\n";
        }else {

                if (
    $db_ADD->addcart("INSERT INTO {$ext}shopping VALUES ('{$_GET["prodid"]}','{$GLOBALS["sessionhash"]}','".$_COOKIE["userid"]."','{$ext}','$timenow','')",1,$ext)){
                   
    header("Location: cart_pop.php?action=viewcart&amp;ext=$ext");

                } else {
                    echo
    " there was a problem adding to the database. Please contact the administrator.";
                    exit;
                }
        }

    success is not by chance, it is by choice.

  2. #2
    SitePoint Guru
    Join Date
    Feb 2004
    Location
    Oregon
    Posts
    686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so nobody has any suggestions?
    success is not by chance, it is by choice.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •