Old 16-10-2006, 17:30   #1 (permalink)
blue tequila
Registered User
 
Join Date: Jul 2006
Location: Staffordshire, UK
Posts: 30
PHP redirecting with anchor

Hey folks,

Just thought i'd share this:

When you redirect with an anchor in PHP using the header location it won't work in IE properly as it corrupts (or something).

Took me hours to figure out!
  Reply With Quote
Old 17-10-2006, 22:31   #2 (permalink)
d3mcfadden
Senior Member
 
d3mcfadden's Avatar
 
Join Date: Apr 2005
Location: -
Posts: 694
Send a message via AIM to d3mcfadden
what do you mean? are you sure you just didnt output whitespace before the header... that will cause it to break.
  Reply With Quote
Old 18-10-2006, 08:50   #3 (permalink)
IdealWebsites
Registered User
 
IdealWebsites's Avatar
 
Join Date: Oct 2006
Location: London, UK
Posts: 29
I think he means linking to a page anchor, like #content

So, the code would be:
header("Location: index.php#content");

I'm pretty sure this should work although I haven't done any tests. Doubt it would help, but what about using the alt code for the #.
  Reply With Quote
Old 17-05-2007, 14:59   #4 (permalink)
blue tequila
Registered User
 
Join Date: Jul 2006
Location: Staffordshire, UK
Posts: 30
Quote:
Originally Posted by IdealWebsites
I think he means linking to a page anchor, like #content

So, the code would be:
header("Location: index.php#content");

I'm pretty sure this should work although I haven't done any tests. Doubt it would help, but what about using the alt code for the #.

Thats exactly it - had to use javascript to pick up something from the querystring instead.
  Reply With Quote
Old 17-05-2007, 21:02   #5 (permalink)
ngsupb
Registered User
 
Join Date: Feb 2007
Posts: 17
weird but I didn't see any problem with php redirect before. Probably there was done something wrong!
  Reply With Quote
Old 18-05-2007, 16:57   #6 (permalink)
R1gM
Senior Member
 
R1gM's Avatar
 
Join Date: Sep 2006
Posts: 275
Just print out a html meta redirect its much easier
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8