Click to See Complete Forum and Search --> : url variable


diamonds
05-30-2003, 03:23 PM
How can you make a variable in the url, without an error? Is it a bug with php?

diamonds
05-30-2003, 03:26 PM
oh, I ment an error when the url is blank, not occupied ;)

pyro
05-30-2003, 03:53 PM
I'm still confused as to what you need. If you are talking about the query string (yourpage.php?query=value), you can reference it with $_SERVER['QUERY_STRING'] or $_GET['query'], where, in the latter, query is the name you gave your value (ie, query=value)

DaiWelsh
05-31-2003, 01:54 AM
perhaps you mean how to handle it not being there? If so check for it with isset($variable) or isset($_GET('variable')) to see whether it exists before using it.

Using an undefined variable will cause a warning which may be reported or ignored depending on your server settings.

diamonds
05-31-2003, 04:22 PM
like this:

http://localhost/index.php?var=1
but i get an error when i do this:
http://localhost/index.php ,Without the "?" at the end. Get me now?

diamonds
05-31-2003, 04:49 PM
Originally posted by DaiWelsh
perhaps you mean how to handle it not being there? If so check for it with isset($variable) or isset($_GET('variable')) to see whether it exists before using it.


I just reviewed your post and I get what it means now :)
I'll try it some time today