Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP Header Function Crashes Browser

Status
Not open for further replies.

badley

Technical User
Dec 20, 2002
75
GB
Hi,

I have noticed a consistent problem with Safari and FF but not with IE.

After processing a form and submitting it to MySQL I use the Header function to redirect, no problem so far.

So some reason when I use Safari or FF the browser detects the header redirect (states new URL within address bar) but never actually loads it, then after a minute or two page cannot be displayed appears. I have to restart the browser then the site works again. IE works fine every time (makes a change).

Would this be something to do with sessions? If so what can be done

Any help would me much appreciated

Running PHP v4.3.1
 
very unlikely to be anything to do with the browser.

please post your code so that we may assist.
 
Thanks

Example Code:

After update SQL

if (mysql_affected_rows() == 1)
{
$email = $_SESSION['usr_email'];
$tell_yyyyy = "Email: $email\n\n";
$tell_yyyyy .= "Has updated the following product: {$pdt_part}\n";
$to = "xxxxx@xxxxx.co.uk";
$subject = $_SESSION['usr_first_name'] . " " . $_SESSION['usr_last_name'] . " has updated {$pdt_part}";

mail ("$to", "$subject", "$tell_xxxxxx", "From: update@xxxxxx.co.uk \nContent-Type: text/plain; charset=iso-8859-1");


$url = 'item.php?d=' . $pdt_div_id . '&c=' . $pdt_cat_id . '&f=' . $pdt_fly_id . '&p=' . $pdt_id; // Add the page.
header("Location: $url");
}
 
you really need to show us all the code.

the most likely problem is that you've cocked something up by outputting data or otherwise causing some form of server loop. the other alternatives (that you've discovered an anomaly in the PHP core and/or you have a uniquely fubar'd installation) are both possible but less likely.

if you don't want to show us all your code add this to the start and report back any errors

Code:
error_reporting(E_ALL);
ini_set('display_errors', true);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top