$base = $_SERVER["QUERY_STRING"];

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

$base = $_SERVER["QUERY_STRING"];

Post by Vegan »

This inhales the ?object from the URL so I was wondering what I can do to leverage this more?

This comes from wrappers and other chunks of functionality I have accumulated here and there

Code: Select all

 $base = $_SERVER["QUERY_STRING"];
gets a general string

so how about the case here I need to parse off more than one item such as an amazon AISN and perhaps a location tag etc
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: $base = $_SERVER["QUERY_STRING"];

Post by requinix »

Then don't do the fancy "?object" thing I wrote and use normal GET parameters.

Code: Select all

?asin=foo&location=bar
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: $base = $_SERVER["QUERY_STRING"];

Post by Vegan »

I was thinking of using my database for more, got it so run with it is my mantra

so far these recent CPM ads have earned more than old product ads so i have mothballed a lot of old code

I noticed WP does not allow more complex queries either, and I was wondering how come

eg cat=5 and dog=4 type of an idea

a lot of game reviews have multiple categories but WP is not able to select from 2 or more
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: $base = $_SERVER["QUERY_STRING"];

Post by requinix »

Because they aren't using WP? Or they modified it to work? Or maybe the capability is buried somewhere in there.
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: $base = $_SERVER["QUERY_STRING"];

Post by Vegan »

I asked the WP team, not doing that yet. So much for leveraging SQL.

so what do i need to do to tease apart a multiple part URL argument
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: $base = $_SERVER["QUERY_STRING"];

Post by requinix »

If you're able to execute any code at all then you should have $_GET available...
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: $base = $_SERVER["QUERY_STRING"];

Post by Vegan »

Code: Select all

void parse_str ( string $encoded_string [, array &$result ] )
seems to be the best i could find to clean up $base which has the URL of the moment

by using PHP more effectively I was looking at more resources for web sites
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Post Reply