Passing HTML anchors from PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
verbetex
Forum Newbie
Posts: 1
Joined: Thu Mar 18, 2004 7:29 am

Passing HTML anchors from PHP

Post by verbetex »

Hi

I've got a PHP script file that does some processing, and when done, I set the header location like so:

header("Location: ../" . $address);
Where address would be something like "mypage.phtml#end"

In the phtml file, I have <a name="end"></a>

This works in Mozilla Firebird, but doesn't work in IE (The #end seems to be getting stripped off the url) :evil:

Anyone come across this before or know of a workaround?

Cheers
TheBentinel.com
Forum Contributor
Posts: 282
Joined: Wed Mar 10, 2004 1:52 pm
Location: Columbus, Ohio

Re: Passing HTML anchors from PHP

Post by TheBentinel.com »

If you use a full path in the Location:, does it work?

Change:
header("Location: ../mypage.phtml#end");

To:
header("Location: http://yourserver.com/mypage.phtml#end");

See if that has any effect on it.

Does mypage.phtml do any sort of redirection itself?

Do you have a mod_rewrite in your .htaccess file?
Post Reply