Viktor
Viktor

Reputation: 547

PHP Parse Command Line Results with Space in url string

I'm trying to parse the results from Aweber forms and unfortunately they pass the variables back with a space between the two words.

For example we want to capture a phone number and we have to use the field 'custom phone' instead of just 'phone' - its not possible to simply use the form field name 'phone' - I tried it - it doesn't parse into Aweber. Aweber can pass the variables from a form back to a PHP script that can then parse the values.

however the resulting url string that it passes back is

http://example.com/join.php?custom%20phone=123456789&email=etc...

I'm trying to extract the phone # from the command line string however it keeps returning a null

$phone = $_REQUEST['custom%20phone'];

or $phone = $_REQUEST['custom phone'];

doesn't contain any data. so i'm not accessing the request field. $_GET has the same issue.

Is there any way you extract the phone number into the $phone variable in PHP?

Thank you!

Upvotes: 0

Views: 73

Answers (1)

piyush_systematix
piyush_systematix

Reputation: 320

Use below code to get exactly what parameters are returned.

echo "<pre>";
print_r($_REQUEST); 

I tried with the URL you gave and it returned

Array
(
    [custom_phone] => 123456789
    [email] => etc
)

Upvotes: 1

Related Questions