I am new in php:
I want to pass a variable to url from a link, and than get it from there...
Can some one give me an idea...or just a small script...
thanks
I am new in php:
I want to pass a variable to url from a link, and than get it from there...
Can some one give me an idea...or just a small script...
thanks
<a href="?foo">This Is Foo</a>
will result in
/?foo
in your URL bar and can be accessed with: $_SERVER['QUERY_STRING'];
-OR-
<a href="?page=bar">This Is Bar</a>
will result in
?page=bar
in your URL bar and can be accessed with: $_GET['PAGE'];
obviously this:
<a href="?page=bar">This Is Bar</a>
is an exception, and normally you would include a page to link to:
<a href="index.php?page=bar">This Is Bar</a>
i generally leave out the index for cleaner URLS... so far i have yet to see an issue doing it that way
scrupul0us wrote:i generally leave out the index for cleaner URLS... so far i have yet to see an issue doing it that way
Sure, but the obvious next question otherwise would be to ask how to create a link to anothe page with variables to pass