Sometimews I see websites doing something like
www.mywebsite.com/index.php?bla bla bla
Now I want to do something similar and want the bla bla bla to be stored into a variable.
Can someone help me please?
Thanks.
Inurl variables?
Started by TcM, May 17 2007 04:21 AM
4 replies to this topic
#1
Posted 17 May 2007 - 04:21 AM
|
|
|
#2
Guest_Jordan_*
Posted 17 May 2007 - 04:51 AM
Guest_Jordan_*
Those will be the GET variables of a form post. If you had index.php?bla=test&find=1
You retrieve those variables like:
You retrieve those variables like:
$bla = $_GET['bla']; $find = $_GET['find'];
#3
Posted 17 May 2007 - 05:49 AM
Thanks, I knew that I had to use the $_GET command, but I didn't know how to use it!! Thanks!!
#4
Guest_Jordan_*
Posted 18 May 2007 - 04:41 AM
Guest_Jordan_*
You can also put this at the top of each PHP file to grab all variables (without assigning them):
If you add that then the variables are global so you could use $bla anywhere.
if(!empty($_GET)) extract($_GET); if(!empty($_POST)) extract($_POST);
If you add that then the variables are global so you could use $bla anywhere.
#5
Posted 19 May 2007 - 04:04 AM
Well I don't actually need it for this time being. But still thanks, as I learnt something new :) and I learnt how to use the or command lol... discovering!


Sign In
Create Account


Back to top









