Need help in passing variable from page 1 to page 2

Discussion in 'PHP' started by astire, Jan 16, 2009.

  1. #1
    Hi,

    i am using Getresponse auto responder. I want to pass the value of Name on confirmation page. PLease let me know how i can do it.

    Thanks
    Adnan
     
    astire, Jan 16, 2009 IP
  2. crath

    crath Well-Known Member

    Messages:
    661
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    100
    #2
    Is it inside a form element?
     
    crath, Jan 16, 2009 IP
  3. astire

    astire Peon

    Messages:
    353
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes, Its a form. i am using POST method in the form. But i dont know how to get the value on the second page.

    Thanks,
    Adnan
     
    astire, Jan 16, 2009 IP
  4. crath

    crath Well-Known Member

    Messages:
    661
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    100
    #4
    If they are php pages, just use

    <?php echo $_POST['field_name']; ?>
    Code (markup):
    to return the value of the field. be sure to replace field_name with the name of the field you wish to get the value of
     
    crath, Jan 16, 2009 IP
  5. astire

    astire Peon

    Messages:
    353
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I am pasting the form code here too.
     
    astire, Jan 16, 2009 IP
  6. astire

    astire Peon

    Messages:
    353
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #6
    My page was in html. I just saved it as .php and used your code. But it did not work for me at he moment.
    Thanks
    Adnan
     
    astire, Jan 16, 2009 IP
  7. crath

    crath Well-Known Member

    Messages:
    661
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    100
    #7
    did it return anything? any errors?

    how are you getting to the second page, are they hitting a "submit" button on the form? or a link?
     
    crath, Jan 16, 2009 IP
  8. astire

    astire Peon

    Messages:
    353
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I did not get any error but Name was also not displayed.

    When i hit submit button it goes to getresponse page for a fraction of second and then goes to my page. If you wish i can show you my page in private message....

    Thanks
     
    astire, Jan 16, 2009 IP
  9. crath

    crath Well-Known Member

    Messages:
    661
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    100
    #9
    yeah, the cgi page is where the values are being sent, then the browser is just redirected to a new page.

    Mind sending me the cgi file?

    Also, I need to know what fields you want to be able to read from the page after the cgi page
     
    crath, Jan 16, 2009 IP
  10. astire

    astire Peon

    Messages:
    353
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I have posted form code above. Other than that i dont have any cgi file.

    I want name to be appeared in the page. I am sending you PM with actual website and the page i want to show.

    Thanks
    Adnan
     
    astire, Jan 16, 2009 IP
  11. crath

    crath Well-Known Member

    Messages:
    661
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    100
    #11
    Oh, it looks like you are using an external service to manage your forms. That makes things difficult.
     
    crath, Jan 16, 2009 IP
  12. astire

    astire Peon

    Messages:
    353
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Is their any solution for this situation?
     
    astire, Jan 16, 2009 IP
  13. fabregas2014

    fabregas2014 Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    dude use POST and Get methods..
     
    fabregas2014, Jan 16, 2009 IP
  14. crath

    crath Well-Known Member

    Messages:
    661
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    100
    #14
    that option has been ruled out. please read up before replying
     
    crath, Jan 16, 2009 IP
  15. fabregas2014

    fabregas2014 Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    from my understanding u need to get the value of "category2" which is the Name and pass it to the thank you page or redirection page right?
     
    fabregas2014, Jan 16, 2009 IP
  16. astire

    astire Peon

    Messages:
    353
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Third party service (Getresponse) asked me to use post method and i am using the post. But i am unable to get the value of "category2" on my desired page.

    Thanks for help
    Adnan
     
    astire, Jan 16, 2009 IP
  17. silentsea

    silentsea Peon

    Messages:
    149
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #17
    Hello,

    I am working in software as seo company and i want 2 learn the PHP to progress my career is dere any1 can tell me dat from vere i should learn it and hw faster i can learn it.








    Thanks
     
    silentsea, Jan 17, 2009 IP