Forums

PHP

This topic is locked

URL variable in PHP?

Posted 31 Aug 2003 11:53:59
1
has voted
31 Aug 2003 11:53:59 Adam Duffield posted:
I have set up a page that filters results based on the URL variable passed. However, i also want to use this page for 1 instance when there is no URL variable to pass.

The problem i have is that the page expects a variable so when none is given, no data shows up.

Is there anyway to include a variable that will select every record?


------

Sorry, this post has been posted into 2 forums, i forgot there was a PHP forum here and had already posted it in the Dreamweaver forum


Replies

Replied 31 Aug 2003 13:04:59
31 Aug 2003 13:04:59 Iain Stewart replied:
you could use an if else for your varible to filter by, something like

if (isset(http_get_vars['var'])) {
varible = http_get_vars['vars']; }
else {
varible ="%";
}

not exact code but its sunday and i've a hangover.



Iain

head hurts, 'mental note to self, stop banging head !'

Reply to this topic