Variables in the Site Address?

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
Bwsab
Forum Newbie
Posts: 2
Joined: Fri Mar 21, 2008 6:56 pm

Variables in the Site Address?

Post by Bwsab »

Hi,

I've begun noticing something that many websites seem to have php code in their addresses. For example: http://www.questionablecontent.net/view.php?comic=1103 . http://www.questionablecontent.net/view.php must be the actual page. But the next part is the ?comic=1103 . I'm guessing that this code establishes "comic" as a variable with a value of 1103. But I have no idea how to get a page to reference that variable. And multiple websites do this, even this forum ( viewforum.php?f=1 ). Does anyone know how to do this? Thank you so much for your help.

--Aaron "Saib" Babcock, http://www.bwsab.com
User avatar
flying_circus
Forum Regular
Posts: 732
Joined: Wed Mar 05, 2008 10:23 pm
Location: Sunriver, OR

Re: Variables in the Site Address?

Post by flying_circus »

Bwsab wrote:Hi,

I've begun noticing something that many websites seem to have php code in their addresses. For example: http://www.questionablecontent.net/view.php?comic=1103 . http://www.questionablecontent.net/view.php must be the actual page. But the next part is the ?comic=1103 . I'm guessing that this code establishes "comic" as a variable with a value of 1103. But I have no idea how to get a page to reference that variable. And multiple websites do this, even this forum ( viewforum.php?f=1 ). Does anyone know how to do this? Thank you so much for your help.

--Aaron "Saib" Babcock, http://www.bwsab.com

$getComicVariable = $_GET['comic'];
Bwsab
Forum Newbie
Posts: 2
Joined: Fri Mar 21, 2008 6:56 pm

Re: Variables in the Site Address?

Post by Bwsab »

Thank you so much! This was exactly what I was looking for!
Post Reply