Page 1 of 1

PHP GET variables & Mozilla

Posted: Tue Sep 02, 2003 12:55 am
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?

Posted: Tue Sep 02, 2003 3:04 am
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

Posted: Tue Sep 02, 2003 3:14 am
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

Posted: Tue Sep 02, 2003 4:16 am
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

Posted: Tue Sep 02, 2003 12:26 pm
by nigma
Thanks a bunch Twig, mud and bech. I really apreciate your help :)