[Q] Grabbing a Custom Field GET from AWeber in PHP

1 replies
For years I have used pages to grab the GET info forwarded from AWeber to insert a name or some other information into a web page dynamically. I recently tried to do that with a custom field passed from AWeber and it's not working.

Not sure why.

Here is a typical piece of code I use to grab the name field:

Code:
if(isset($_GET['name'])) {

$name = $_GET['name'];

}
If I set up a custom field (lets say "school" to designate what
school the lead attends) AWeber passes it like this in the GET:

?custom%20school=osu

When I try this code it fails:


Code:
if(isset($_GET['custom school'])) {

$name = $_GET['custom school'];

}
This code also fails:

Code:
 if(isset($_GET['custom%20 school'])) {
 
 $name = $_GET['custom%20school'];
 
 }
I'm sure this is some simple answer, but I know just enough about PHP to be dangerous.

Any help would be greatly appreciated.

Kevin
#aweber #custom #field #grabbing
  • Profile picture of the author MemberCon
    I put a small file named test.php on my server, and put this code inside it:

    <?php
    echo '<pre>';
    print_r($_GET);
    echo '</pre>';
    ?>

    then I visited the URL in my browser like this:

    http://www.YOURDOMAINHERE.com/test.p...m%20school=osu

    and it printed out:

    Array
    (
    [custom_school] => osu
    )

    The %20 (URL encoded "space" character) is transformed into an underscore, so the proper GET variable is:

    $_GET['custom_school']

    PHP will transform characters that are not valid in variable names into underscores (PHP: Variables From External Sources - Manual)
    {{ DiscussionBoard.errors[1341022].message }}

Trending Topics