Reply
returning php get names
Old 03-18-2006, 01:09 PM returning php get names
purk's Avatar
Extreme Talker

Posts: 164
Name: James
Location: marbella & surrey
I want to return the names of the gets in my url.

i.e. www.mydomain.com?this

I want the this but I may not know its name.

I had hoped I could just use $k = $_GET[0] but this returns an empty array.

Any clues?? php.net doesn't go in to that much detail.


Thanks folks
__________________
thatVilla.com - private villas direct from the owners - travel links always needed.
purk is offline
Reply With Quote
View Public Profile Visit purk's homepage!
 
When You Register, These Ads Go Away!
     
Old 03-18-2006, 01:16 PM Re: returning php get names
Christopher's Avatar
Iced Cap

Latest Blog Post:
PHP and Unicode with UTF-8
Posts: 3,108
Location: Toronto, Ontario
I htink you'll have to test an array of values to see if they exist.

PHP Code:
$values = array('shownews''viewform''contactus''signup');

$action 'shownews'// default

foreach($values as $val)
{
    if(
array_key_exists($val$_GET))
    {
        
$action $val;
        break;
    }
}

// if script.php?signup, $action='signup' 
Christopher is offline
Reply With Quote
View Public Profile Visit Christopher's homepage!
 
Old 03-18-2006, 01:18 PM Re: returning php get names
Average Talker

Posts: 26
Location: the Netherlands
$_SERVER['QUERY_STRING']

That should fix your problem .
PeterB is offline
Reply With Quote
View Public Profile Visit PeterB's homepage!
 
Old 03-18-2006, 01:20 PM Re: returning php get names
Christopher's Avatar
Iced Cap

Latest Blog Post:
PHP and Unicode with UTF-8
Posts: 3,108
Location: Toronto, Ontario
Then you'll have to parse it for the values. Though I guess that isn't too hard either.
Christopher is offline
Reply With Quote
View Public Profile Visit Christopher's homepage!
 
Old 03-18-2006, 01:26 PM Re: returning php get names
purk's Avatar
Extreme Talker

Posts: 164
Name: James
Location: marbella & surrey
genius, thanks chroder
__________________
thatVilla.com - private villas direct from the owners - travel links always needed.
purk is offline
Reply With Quote
View Public Profile Visit purk's homepage!
 
Reply     « Reply to returning php get names
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13039 seconds with 13 queries