A Digital Age Deserves A Digital Leader

PHP links

PHP links

Postby [Dima] » Thu Jul 01, 2004 7:55 pm

Well i got a website... i started again... fresh and now i want to have it all php based (well most of it) but im not sure how to get the links working like "index.php?id=page_one" as im quite a new at php. But i know some stuff :dontgetit

can someone sugest a tutorials or whatever to help me please?

thanks
[Dima]

Postby Weaver » Thu Jul 01, 2004 8:22 pm

You are going to have to gain familiarity with manipulating the query string if you want to use the specifics you mentioned above.

There are quite honestly hundreds of ways of implementing an ?id=page_one like setup.

All variables passed in via the query string are accessible via the superglobal $_GET array. Let's say someone requests the page http://test.com/index.php?id=mydoc&page=2 . If register_globals is turned on (which is highly discouraged for security) then two variables would be created called $id and $page and they would be created in global scope.

If register_globals is turned off then the variables would be accessible from $_GET['id'] and $_GET['page'].

You can then use fopen() or include() or some other mechanism to open up files represented by these values. Tada.

-Weaver
Public Keys

The primary purpose of the DATA statement is to give names to constants; instead of referring to pi as 3.141592653589793 at every appearance, the variable PI can be given that value with a DATA statement and used instead of the longer form of the constant. This also simplifies modifying the program, should the value of pi change.
-- FORTRAN manual for Xerox Computers
PROfessional Member
User avatar
Posts: 1967
Joined: Wed Jun 19, 2002 12:05 am
Location: /home/weaver/

Postby [Dima] » Thu Jul 01, 2004 8:26 pm

well thank you for your explanation... im going to test it now! ^*^
[Dima]

Postby [Dima] » Fri Jul 02, 2004 1:14 pm

YEYE!!!! after a few hours (more like 20) i got the links to work!!! ^*^

thank you weaver!!

heres the site btw (still not anywhere near comletion) http://keitx.myftp.org
[Dima]

Postby xi0n » Fri Jul 02, 2004 11:37 pm

i would clap -cept the site can not be found..
Image
Banned
User avatar
Posts: 27
Joined: Thu Jul 01, 2004 11:46 am

Postby [Dima] » Sat Jul 03, 2004 12:11 pm

[Dima]

Postby xi0n » Sat Jul 03, 2004 12:41 pm

nice - just wonderin on the hedda on ya site - whats that font?
Image
Banned
User avatar
Posts: 27
Joined: Thu Jul 01, 2004 11:46 am

Postby [Dima] » Sat Jul 03, 2004 1:46 pm

not too sure... it came with windows xp pro i think (font folder)
[Dima]

Return to HTML, CSS, and Scripts

Who is online

Users browsing this forum: No registered users and 7 guests

cron
cron