• 0
Sign in to follow this  
kandrade

Method Post

Question

E ai galera do SB

estou com um probleminha com o METHOD POST.......abaixo esta o codigo do arquivo

form.html

<HTML>
<HEAD>
<TITLE>HTML FORM</TITLE>
</HEAD>
<BODY>
<FORM ACTION="HandleForm.php" METHOD=POST>
First Name <INPUT TYPE=TEXT NAME="FirstName" SIZE=20><br>
Last Name <INPUT TYPE=TEXT NAME="LastName" SIZE=40><br>
E-mail <INPUT TYPE=TEXT NAME="Email" SIZE=60><br>
Comments <TEXTAREA NAME="Comments" ROWS=5 COLS=40></TEXTAREA><br>
<INPUT TYPE=SUBMIT NAME="SUBMIT" VALUE="Submit!">
</FORM>
</BODY>
</HTML>
criei então o arquivo HandleForm.php o codigo esta abaixo:
<HTML>
<HEAD>
<TITLE>Form Results</TITLE>
</HEAD>
<BODY>
<?php
print "Your first name is $FirstName . <br>\n";
print "Your last name is $LastName . <br>\n";
print "Your E-mail address is $Email . <br>\n";
print "This is what you had to say: <br>\n$Comments\n";
?>
</BODY>
</HTML> 

e as variaveis não recebem os valores.......

alguém pode me ajudar.....

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Você precisa receber as variáveis do post

Use assim...

<?php
  //no arquivo que recebe as variaveis
  $FirstName = $_POST['FisrstName'];
  $LastName = $_POST['LastName'];
  print "Your first name is $FirstName . <br>\n";
  print "Your last name is $LastName . <br>\n";//e demais variaveis
?>

Ah e crie o hábito de usar letras minúsculas no html para se acostumar com XHTNL que é a nova tendencia dos browsers...

[]s

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this