So, I'm having what is probably a really basic brain fart here. I have a script that's getting code back from Aweber after someone confirms a subscription. The URL contains subscriber data, in this format, as it appears in the location bar: Code: http://example.com/scriptname.php?email=user%40example.com&from=user%40example.com&meta_adtracking=adtrackcode&meta_message=1&name=Freddie&unit=listname&add_url=http%3A%2F%2Fexample.com%2Ffirstscript.php%3Fpage%3D678&add_notes=256.0.0.7&custom%20ref=678
PHP problem: Extracting a value from a query string
13
So, I'm having what is probably a really basic brain fart here. I have a script that's getting code back from Aweber after someone confirms a subscription. The URL contains subscriber data, in this format, as it appears in the location bar:
I am attempting to extract that last value (678) from the query string, using this bit of code:
I've tried it as $_GET['custom ref'] and $_GET['custom%20ref'], and it makes no difference. All it ever returns is the default value of '1'.
What am I screwing up?
Paul
Code:
http://example.com/scriptname.php?email=user%40example.com&from=user%40example.com&meta_adtracking=adtrackcode&meta_message=1&name=Freddie&unit=listname&add_url=http%3A%2F%2Fexample.com%2Ffirstscript.php%3Fpage%3D678&add_notes=256.0.0.7&custom%20ref=678
I am attempting to extract that last value (678) from the query string, using this bit of code:
Code:
<?php
error_reporting (E_ALL ^ E_NOTICE);
$default = 1;
$value = $_GET['custom ref'];
if($value != "") {
$newvalue = $_GET['custom ref'];
} else {
$newvalue = $default;
}
?> What am I screwing up?
Paul
- psvent
- [ 1 ] Thanks
- Paul Myers
- [1] reply
- prince55l
- [ 1 ] Thanks
- [1] reply
- Paul Myers
- [1] reply
- David Beroff
- [ 1 ] Thanks
- [1] reply
Next Topics on Trending Feed
-
13