Page 1 of 1

Variables in the Site Address?

Posted: Fri Mar 21, 2008 7:04 pm
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

Re: Variables in the Site Address?

Posted: Fri Mar 21, 2008 7:15 pm
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'];

Re: Variables in the Site Address?

Posted: Fri Mar 21, 2008 7:54 pm
by Bwsab
Thank you so much! This was exactly what I was looking for!