starnge problem in passing variables.

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

  1. #1
    Hi,
    I am passing values of two fields (Name and email) to the next page via post method.
    I am successfully passing both values via get method but via post method only Name value is passed. here are the codes i am using

    Please can some one explain me whats the error

    Thanks
    Adnan
     
    astire, Jan 21, 2009 IP
  2. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #2
    did you try interchanging the code of both the emails?
     
    bartolay13, Jan 22, 2009 IP
  3. Gangsta

    Gangsta Active Member

    Messages:
    145
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    you should check source that post this variables first
     
    Gangsta, Jan 22, 2009 IP
  4. ActiveFrost

    ActiveFrost Notable Member

    Messages:
    2,072
    Likes Received:
    63
    Best Answers:
    3
    Trophy Points:
    245
    #4
    Check if you've correctly set the form passing method !
    If you've set it to POST - no way you could access it with $_GET variable .. So I would say - your email variable containing form is set to GET.
     
    ActiveFrost, Jan 22, 2009 IP
  5. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #5
    make sure you have this on form
    <form action="yourfile" method="POST">

    and input name = email

    then just to a print_r($_POST) to see vars u got
     
    crivion, Jan 22, 2009 IP
  6. chmdznr

    chmdznr Active Member

    Messages:
    417
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    78
    #6
    or try using: $_REQUEST['email']
     
    chmdznr, Jan 22, 2009 IP
  7. t3nt3tion

    t3nt3tion Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    If you pass alot of variables, make sure suhosin is not causing you issues.
     
    t3nt3tion, Jan 22, 2009 IP
  8. mrmaf

    mrmaf Peon

    Messages:
    41
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Yeah I agree with chmdznr, you should use $_REQUEST['email'] because it works with both get and post method.
    Also the email field should be <input type="text" name="email" id="email">
     
    mrmaf, Jan 23, 2009 IP