form in php not redirecting to page after submitting


i have a form in php which i created like a calculator, i have used angular js to display the user entered value on the display, which i designed like below:


if(isset($_POST['entering'])) {
} else {
    $msg="Something Went Wrong. Please try again.";

  <script src=""></script>

  <div class='container'>
    <div class='ct-inner'>

      <!-- Project HTML Below -->
      <div ng-app="" class='calculator'>
        <div class='inner'>

          <div class='innerIn'>
            <div style="height:49px;" class='screen active'>
              <div class='output'> {{name}}</div>

              <div class='screen-layer'></div>

            <form method="post" action="">
              <div class='controls'>

                <div style="margin-top:5%;" class="form__group">
                  <input ng-model="name" type="password" class="form__input" id="name" placeholder="Password" required="" maxlength="6" />

                <div style="margin-left:35%; margin-top:1%;" class='control-pad operator-pad1'>

                  <input type="button" class='button med oper' name="entering" value="ENTER">

          <!-- Inner in End -->

this is my whole code, when i am trying to submit the form entering values its not going to different page after submission, can anyone please tell me what could be wrong here, thanks in advance


From the Docs:

Since the role of forms in client-side AngularJS applications is different than in classical roundtrip apps, it is desirable for the browser not to translate the form submission into a full page reload that sends the data to the server. Instead some javascript logic should be triggered to handle the form submission in an application-specific way.

For this reason, AngularJS prevents the default action (form submission to the server) unless the <form> element has an action attribute specified.

You can use one of the following two ways to specify what javascript method should be called when a form is submitted:

  • ngSubmit directive on the form element
  • ngClick directive on the first button or input field of type submit (input[type=submit])

For more information, see

Answered By – georgeawg

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published