I am using an aweber form to pass user data to my website. aweber is passing a viaraible with a space in it, which is showing up in the URL like this: &custom%20affid=3 I ahve no control over this, so I can't use urlencode or anything... ..but for hours I ahve been trying to work out how to $_GET that variable.. ..but I can't. I am out of ideas. Can anyone help me?
Never mind, I figured out a solution: <?php if (strpos($_SERVER['QUERY_STRING'],'custom%20affid') !== false) { $new_string = str_replace ('custom%20affid','custom_affid', $_SERVER['QUERY_STRING']); header('Location: thanks-confirmed.php?'.$new_string.''); } ?> Code (markup): Echo the custom field: <?php echo $_GET['custom_affid']; ?> Code (markup):
You are KIDDING me!!?? I just spent 4 hours crying because it wouldn't work.. and I ended up having to write all that code.. ..and you're telling me all I had to do was add an underscore? Ok, that's enough internet for me today. I am going to go and scream myself to sleep... *but thanks for replying.
To add insult to injury: http://bytes.com/topic/php/answers/784029-url-parameters-space-variable-name - hit # 8 on a google-search with "how to get an url variable php with spaces"