Please I am designing a website with Bootstrap framework, but my contact form does not display the processed input. I am a newbie and need help in correcting my mistakes to get the "contact us" form work as expected.
Meanwhile, I am using Wamp and have the following codes:
<div class="container">
<div class="col-sm-12">
<div class="row">
<form id="contact-form" method="post" action="welcome2.php" role="form">
<div class="form-group has-error has-feedback">
<label for="name">Name</label>
<input type="text" class="form-control" id="name" placeholder="Enter your name*"
required="required" data-error="Name is required">
<div class="help-block with errors" value="<?php echo $name; ?>"></div>
</div><br>
<div class="form-group has-error has-feedback">
<label for="email">Email</label>
<input type="text" class="form-control" id="email" placeholder="Enter your email*"
required="required" data-error="Email is required">
<div class="help-block with errors" value="<?php echo $email; ?>"></div>
</div><br>
<div class="form-group has-error has-feedback">
<label for="message">Message</label>
<textarea class="form-control" id="form-message" name="message placeholder="Message for me *" rows="4"
required="required" value="<?php echo $message; ?>"></textarea>
<div class="help-block with errors"></div>
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
</div>
</div>
</div>
<body>
Welcome <?php echo $_POST["name"]; ?><br>
Your email address is: <?php echo $_POST["email"]; ?><br>
Your message: <?php echo $_POST["message"]; ?><br>
</body>
</html>
So, I expect the <?php echo $_POST[""]; ?> to display the values in the input field after the user clicks the submit button.
Meanwhile, I am using Wamp and have the following codes:
<div class="container">
<div class="col-sm-12">
<div class="row">
<form id="contact-form" method="post" action="welcome2.php" role="form">
<div class="form-group has-error has-feedback">
<label for="name">Name</label>
<input type="text" class="form-control" id="name" placeholder="Enter your name*"
required="required" data-error="Name is required">
<div class="help-block with errors" value="<?php echo $name; ?>"></div>
</div><br>
<div class="form-group has-error has-feedback">
<label for="email">Email</label>
<input type="text" class="form-control" id="email" placeholder="Enter your email*"
required="required" data-error="Email is required">
<div class="help-block with errors" value="<?php echo $email; ?>"></div>
</div><br>
<div class="form-group has-error has-feedback">
<label for="message">Message</label>
<textarea class="form-control" id="form-message" name="message placeholder="Message for me *" rows="4"
required="required" value="<?php echo $message; ?>"></textarea>
<div class="help-block with errors"></div>
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
</div>
</div>
</div>
<body>
Welcome <?php echo $_POST["name"]; ?><br>
Your email address is: <?php echo $_POST["email"]; ?><br>
Your message: <?php echo $_POST["message"]; ?><br>
</body>
</html>
So, I expect the <?php echo $_POST[""]; ?> to display the values in the input field after the user clicks the submit button.