...

View Full Version : call a variable from the url?



DiarYofaMadmaN
04-30-2004, 07:09 AM
I'm trying to control the layout of my site with the url. Instead of setting the variables in the php page set them in the url and just call them in the .php page. Is this possible to do?

I'm trying to peice together my dynamic database driven site. By doing this I want to keep the number of pages down to a minumum and do the necessary page updates in my database.

-peace,
Rich

firepages
04-30-2004, 09:32 AM
for sure ..

with the url...
...domain.com/page.php?var1=this&var2=that



page.php
<?php
echo $_GET['var1'] . '<br />' . $_GET['var2'];
?>

DiarYofaMadmaN
04-30-2004, 09:56 PM
Thanks!

Haunted
05-02-2004, 05:32 PM
Firepages, I was just wondering is a difference between $_REQUEST['var'] and $_GET['var']?

firepages
05-02-2004, 05:59 PM
well $_REQUEST contains of $_POST,$_GET & $_COOKIE variables , if you don't know where a variable is coming from (e.g GET or POST) then $_REQUEST will work regardless.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum