Page 1 of 1

$base = $_SERVER["QUERY_STRING"];

Posted: Fri Dec 30, 2016 8:30 pm
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

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

Posted: Fri Dec 30, 2016 8:49 pm
by requinix
Then don't do the fancy "?object" thing I wrote and use normal GET parameters.

Code: Select all

?asin=foo&location=bar

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

Posted: Fri Dec 30, 2016 9:29 pm
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

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

Posted: Fri Dec 30, 2016 10:34 pm
by requinix
Because they aren't using WP? Or they modified it to work? Or maybe the capability is buried somewhere in there.

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

Posted: Sat Dec 31, 2016 7:15 pm
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

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

Posted: Sat Dec 31, 2016 7:22 pm
by requinix
If you're able to execute any code at all then you should have $_GET available...

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

Posted: Fri Jan 13, 2017 11:06 am
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