Jump to content

Really simple question about a form and $_POST vars


Perfidus

Recommended Posts

I don't know where's the problem with this form, but I can't manage to send the vars to the PHP.

They are always empty.

Everything looks normal for me.

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
                       <form method="POST" action="sendmail.php" id="commentForm" enctype="text/plain" >
                            
            <table width="100%" border="0" cellspacing="5" cellpadding="5">
                  <td bgcolor="#FFE391"><label for="cname">Name</label></td>
                <td colspan="6" bgcolor="#FFE391">
                  <input name="cname" type="text" id="cname"/>
                </td>
                </tr>
                <tr>
                  <td bgcolor="#FFE391"><label for="ccity">City</label></td>
                  <td colspan="6" bgcolor="#FFE391"><input id="ccity" name="ccity"/>
            </td>
                </tr>
                <tr>
                  <td bgcolor="#FFE391"><label for="czip">Zip</label></td>
                  <td colspan="6" bgcolor="#FFE391"><input id="czip" name="czip"/>
            </td>
                </tr>
                <tr>
                  <td bgcolor="#FFE391"><label for="cemail">E-mail</label></td>
                  <td colspan="6" bgcolor="#FFE391"><input id="cemail" name="cemail"/></td>
                </tr>
              <tr>
                <td colspan="7" bgcolor="#FF9224" class="table_titles">
                  <input class="submit" type="submit" value="Send"/>
                </td>
                </tr> 
                </table>                
                </form>
</body>
</html>


<?Php
echo "
Name: ".$_POST['cname']."<br />
City: ".$_POST['ccity']."<br />
Zip: ".$_POST['czip']."<br />
E-mail: ".$_POST['cemail']."<br />";
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.