PHP GET variables & Mozilla

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
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

PHP GET variables & Mozilla

Post by nigma »

I use the one page method of page navigation. You can see it at http://nigmanet.net. Depending on the value of the GET variable a specific page will be included. For some reason in NN and Mozilla I get a 404 error whenever I try to use that sane method of page navigation.

I have a link like this:
<a href="/?id=1">PAGE 1</a>

And in netscape when that link is clicked it takes you to this URL:
http://nigmanet.net/%5C?id=1

Can someone help me with this?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

try changing your code for the link from

Code: Select all

<a class="nav" href="\?id=0">News</a>
to

Code: Select all

<a class="nav" href="?id=0">News</a>
i think the backslash is messing it up. If that doesn't work, try a forward slash.

Mark
User avatar
mudkicker
Forum Contributor
Posts: 479
Joined: Wed Jul 09, 2003 6:11 pm
Location: Istanbul, TR
Contact:

Post by mudkicker »

no no the second code is the right one no back or forward slashes!

but if for example you have a site http://www.site.com and you use the index.php for this one page nav method.

you can give the address so:

Code: Select all

www.site.com/?page=3
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

I came up against this problem myself and the solution that we now use is to ensure that the name of the page is also included, so that instead of:

Code: Select all

<a href="?id=1">PAGE 1</a>
we'd have

Code: Select all

<a href="pagename.php?id=1">PAGE 1</a>
You can use $_SERVER['PHP_SELF'] to get the page name if you need it to be more dynamic.

Mac
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post by nigma »

Thanks a bunch Twig, mud and bech. I really apreciate your help :)
Post Reply