Newbie desperate for help please

Discussion in 'Programming' started by hcbeggar, Jan 24, 2009.

  1. #1
    Ok, I am desperate to find this answer if any coder can help me I would be grateful.
    So here is my situation:
    I figured out how to pass variables from one page to another and to a url. So my next question is:
    Is there a way to pass variables out of my url or from a section of the web page and place it into the subid section of an affiliate link.

    So there is no confusion at all this is my goal.
    1) Have a person fill out form on h**p://www.surveybeggar.com/test.html (It's a bit crude looking right now)

    a)So I fill out my Name: Eric & My Email: test@test<dot>com

    2) when that person fills out the form they are redirected to a new page with the URL:
    h**p://www.surveybeggar.com/test2.html?FirstName=Eric&Email=test@test.com

    a) as you can see the first name & email are added to the domain but also on that page I have passed those two variables as text.

    Now here is what I want to have done....
    There are two affiliate banner ads on this page. Currently they are just my normal affiliate banner codes WITHOUT sub ids. However, I want to add the email variable that is in the url &/or on the page above and have it automatically populate itself as a sub id in the banner ads.
    Can someone please help me learn how to do this or give me the snippet to add to the end of my affiliate banner code that will populate the email variable?

    thanks for any help.
    ~eric
     
    hcbeggar, Jan 24, 2009 IP
  2. hcbeggar

    hcbeggar Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #2
    Will offer $10 via paypal, alert pay, or revolutionmoney exchange to anyone who can help!
     
    hcbeggar, Jan 24, 2009 IP
  3. NinjaWork

    NinjaWork Guest

    Messages:
    132
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hi hcbeggar,

    To get at the variable, use $_GET['FirstName'] & $_GET['Email']

    To place this on a php enabled page, use:

    
    http://some_domain.com/some_link/script.php?Name=<?php echo $_GET['Firstname']; ?>&Email=<?php echo $_GET['Email']; ?>
    
    Code (markup):
    There is a shortcut for echoing the variables, but it isn't always enabled:

    
    http://some_domain.com/some_link/script.php?Name=<?=$_GET['Firstname']?>&Email=<?=$_GET['Email']?>
    
    Code (markup):
     
    NinjaWork, Jan 24, 2009 IP
  4. hcbeggar

    hcbeggar Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    Hey Ninja,
    I am still not right here...& I would like to apologize cause it might be right in front of me but I am just in a haze. I appreciate you helping.

    I have an affiliate banner with the following code:

    <a href="http://partners.pantheranetwork.com/z/3945/CD5923/&subid1=email"><img src="http://partners.pantheranetwork.com/42/5923/3945/&subid1=email" alt="" border="0"></a>

    What I want to do is trade that word email that is in red with the email from the url or that is already on the page that I have passed from a previous page. How can I add the email address where I have put the word email in this code?
     
    hcbeggar, Jan 24, 2009 IP
  5. NinjaWork

    NinjaWork Guest

    Messages:
    132
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hi hcbegger,

    when you redirect the user using:
    h**p://www.surveybeggar.com/test2.html?FirstName=Eric&Email=test@test.com

    you have two key-value pairs: FirstName=Eric and Email=test@test.com

    To access those, you use the special php variable $_GET['key'] which equals value...so $_GET['FirstName'] equals "Eric" and likewise for $_GET['Email']

    Now, to get them into your code:

    <a href="http://partners.pantheranetwork.com/z/3945/CD5923/&subid1=email"><img src="http://partners.pantheranetwork.com/42/5923/3945/&subid1=email" alt="" border="0"></a>

    you just replace "email" with the following code:

    
    <?php echo $_GET['Email']; ?>
    
    Code (markup):
    and end up with this:

    
    <a href="http://partners.pantheranetwork.com/z/3945/CD5923/&subid1=<?php echo $_GET['Email']; ?>"><img src="http://partners.pantheranetwork.com/42/5923/3945/&subid1=<?php echo $_GET['Email']; ?>" alt="" border="0"></a>
    
    Code (markup):
    which should work as long as php parsing is enabled for the pages.
     
    NinjaWork, Jan 24, 2009 IP
  6. hcbeggar

    hcbeggar Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #6
    Ninja,

    I feel like I am almost there & I totally appreciate your help...

    Ok, so I did what you told me to and of course it doesnt work. If you want to see what I have done, please view source of the following website:

    h**p://www.surveybeggar.com/test2.html?FirstName=Eric&Email=test@test.com

    Ok, so I can only assume that I either left something out of the code above or it doesnt let me PHP parse. I believe that its mainly javascript. Is there a get function for java?
    I only added the code you gave me for the first banner and it just shows up as written
    <?php echo $_GET['Email']; ?>
     
    hcbeggar, Jan 24, 2009 IP
  7. NinjaWork

    NinjaWork Guest

    Messages:
    132
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hi hcbegger!

    This, of course, is the fun of web development ;-)

    It looks like php is not being parsed. You can try to add this to your .htaccess file in that directory:

    
    AddType application/x-httpd-php .htm .html
    
    Code (markup):
    I'm not a Javascript person, though...maybe someone else here at digital point would know how to get the variables from a query string and put them into a string.
     
    NinjaWork, Jan 24, 2009 IP
  8. hcbeggar

    hcbeggar Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #8
    Ninja
    thanks so much for the effort, I truly appreciate the effort

    For anyone else, I need javascript help!!!...please read the previous threads and if anyone helps, I will pay you via paypal for the code to insert and help.
     
    hcbeggar, Jan 24, 2009 IP
  9. NinjaWork

    NinjaWork Guest

    Messages:
    132
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    NinjaWork, Jan 24, 2009 IP