Problems with HTML Form and using PHP with Wamp

26 Views Asked by At

I wrote a working html file, and I want to send the information to a PHP, but the format is wrong, and I don't know how to fix it. I'm also new to this too.

This is the html and I'm pretty sure it works.

<!DOCTYPE html>

<html>
<head>
    <title></title>
</head>
<body>
<form action='test.php' method='POST' encoding-type='multipart/form-data'>
    <fieldset>
  <table width='500'>
    <tr>
        <td><label from='FirstName'>First Name: </label></td>
        <td><input type='text' id='FirstName' name='FirstName' size='50' maxlength='50' placeholder='Enter you firstname'/></td>
    </tr>
    <tr>
        <td><label from='LastName'>Last Name: </label></td>
        <td><input type='text' id='LastName' name='LastName' size='50' maxlength='50' placeholder='Enter you lastname'/></td>
    </tr>
    <tr>
        <td><label from='Email'>Email Address: </label></td>
        <td><input type='email' id='Email' name='Email' size='50' maxlength='50' placeholder='Enter you email address'/></td>
    </tr>
    <tr>
        <td><label from='Password'>Password: </label></td>
        <td><input type='password' id='Password' name='Password' size='50' maxlength='20'/></td>
    </tr>
    <tr>
        <td><label from='Comments'>Comments: </label></td>
        <td><textarea cols='50' rows='10' name='Comments' id='Comments'
        placeholder='Enter you comments here.(Maximum 500 words)'></textarea></td>
    </tr>
    <tr>
        <td><input type='submit' name='submit' value='Submit'</td>
    </tr>
  </table>
    </fieldset>
</form>
</body>
</html>

And this is the php file. I put the php file in wamp's www too. and tested it there. I'm extremely new to php so I don't really know the rules yet. By the way I used Komodo ide to make it.

<html>
    <body>

Welcome <?php echo $_POST["FirstName"];?><?php echo $_POST["LastName"];?><br>
Email Address: <?php echo $_POST["Email"];?><br>
Password: <?php echo $_POST["Password"];?><br>
Comments: <?php echo $_POST["Comments"];?>

    </body>
</html>

when I click the submit button this shows up.

<html>
    <body>

Welcome <?php echo $_POST["FirstName"];?><?php echo $_POST["LastName"];?><br>
Email Address: <?php echo $_POST["Email"];?><br>
Password: <?php echo $_POST["Password"];?><br>
Comments: <?php echo $_POST["Comments"];?>

    </body>
</html>

but when i run it on the komodo ide configure browser it shows this instead when i press configure.

Welcome
Email Address:
Password:
Comments: 

I don't even know what's the problem.

0

There are 0 best solutions below