Jump to content

Inurl variables?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
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.

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Those will be the GET variables of a form post. If you had index.php?bla=test&find=1
You retrieve those variables like:

$bla = $_GET['bla'];
$find = $_GET['find'];


#3
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Thanks, I knew that I had to use the $_GET command, but I didn't know how to use it!! Thanks!!

#4
Guest_Jordan_*

Guest_Jordan_*
  • Guests
You can also put this at the top of each PHP file to grab all variables (without assigning them):

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
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
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!