Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 30th, 2004, 06:56 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default header() acting strangely....

Before I say anything else, I do not have a problem, but I'm curious about the behavior of the header() redirect.

This code:

<?php
//this is firstpage.php
header("Location: nextpage.php");
?>

...works fine except for one thing. Sometimes the Address Bar does not change from saying 'firstpage.php'. Most of the time it does, but sometimes it doesn't.

Is this an IE header bug, or is something happening on the server-side? Does anyone else encounter this behavior?

Thanks for your interest,

Snib

<><
__________________
-Snib - http://www.snibworks.com
Where will you be in 100 years?
 
Old July 1st, 2004, 10:49 AM
Authorized User
 
Join Date: Jun 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

haven't tried it myself, but does it behave the same way if you try it in others browsers like opera and mozilla?
 
Old July 1st, 2004, 11:17 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I don't have those browsers..... this computer only has IE.

Thanks,

Snib

<><
 
Old July 1st, 2004, 12:22 PM
Authorized User
 
Join Date: Jun 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i'll have a look at it in opera (and any other browser/browsers i have installed) when i get back on my own comp in a few days though...

but without having tested it myself, i'd be inclined to say it was a problem with IE that's causing your problem. wouldn't surprise me at all.
 
Old July 2nd, 2004, 06:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'd second that. 'Location: newplace.php' is a redirect, and a redirect should display in the address bar.

Dan
 
Old July 15th, 2004, 01:41 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 101
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Moharo
Default

remember to do exit after header("location: something.php"), it's for security issues... :

header("location: test.php");
exit;

:D

www.campusgrind.com the college portal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Top percent Query acting strangely in access 2002 jeremy1048 Access 4 January 15th, 2008 09:27 AM
Server acting as browser - handling cookies? Philibuster PHP How-To 1 August 15th, 2006 09:39 PM
User-Level Security Wizard acting funny Bob Bedell Access 1 January 7th, 2006 02:53 AM
DataAdapter.Update acts strangely oricalchis ADO.NET 0 September 21st, 2005 06:21 AM
POST method behave strangely laxenai Beginning PHP 1 May 4th, 2004 12:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.