How do I return the result from a post in the original html?
For example in my form, I submit an email address. After the email address is submited I would like to show that email back in a div and hide the form.
How can I do that using angularjs and php?
simple HTML form
<form name="EmailForm" class="form-horizontal" method="post" action="mail_handler.php">
<div class="form-group form-group-lg">
<input id="email" type="email" name="email" class="form-control size" ng-model="email.text" placeholder="me@example.com" required>
</div>
<div class="form-group">
<label ng-show="EmailForm.email.$valid"><input ng-model="IAgree" name="tos" required="required" type="checkbox" /> I have read and agree to the Terms of Service</label>
</div>
<div class="form-group">
<button type="submit" name="submit" ng-show="IAgree" class="btn btn-lg btn-primary">
<span class="glyphicon glyphicon-play-circle" aria-hidden="true"></span>
Spam me now!
</button>
</div>
</form>
and a simple php
<?php
if(isset($_POST['submit'])){
$email = $_POST['email'];
header('Location: index.html');
}
?>