No action when I press submit button in an html form on remote server

I have created an html form in a .php which post to another .php file named "assignNotifications". Here is the first line of the form

form method="post" class="form-horizontal" action="assignNotifications.php"

and the submit button

input class="btn btn-info btn-block" type="submit" name="submit" value="Submit"

I am using bootstrap as well in my form.

I run the exact same code from my localserver as well as from the remote server. Here is the scenerio:

When I submit the form on my localserver it works fine and submit to the local file.

When I submit the form on my localserver with action="theRemoteServerAddress/assignNotifications.php" , It still works fine and submit to the file on remote server.

But when I submit the form from the file on the remote server to the other file on the remote server. It does not work whether I use action="assignNotifications.php" or action="theRemoteServerAddress/assignNotifications.php" . No action take place when I press submit.

It is a really strange scenerio. Can you please suggest why this problem occur?

EDIT1: Here is the complete code of the form

<form method="post" class="form-horizontal" action="assignNotifications.php">
    
    <div class="form-group">
        <label for="message"> Message: </label> <br/>
        <textarea name="message" class="form-control" cols="30" rows="3">
            Type your message Here!
        </textarea>
        <br/>
    </div>
  
    <!--div class="form-group"-->
    <div class="checkbox">
        <label>
        <input type="checkbox" name="SelectAll" value="SelectAll" > <strong> Select All </strong> <br/>
        </label>
    </div>
    <!--/div-->
    <h3>OR </h3> <br/>


<?php  
    
  // Loop through the array of student data, formatting it as HTML
  while ($row = mysqli_fetch_array($data)) { 
    // Display the score data
    echo "<div class='form-group col-md-8 col-md-offset-4'>";
        //echo "<label>";
        echo "<input type='checkbox' name='person[]' id='person' value='$row[email]'> $row[username]";
        //echo "</label>";
    echo "</div>";
  }
  mysqli_close($dbc);
?>

    <div class="col-md-4 col-md-offset-4 text-center">
        <input class="btn btn-danger btn-block" type="reset"> <br/>
        <input class="btn btn-info btn-block" type="submit" name="submit" value="Submit">
    </div>
</form>

1 answer

  • answered 2017-08-16 19:27 smart.Waqar

    I am able to resolve the error. Although I am still not sure why the code keep working on the local server while it did not work the remote server.

    So Here is the solution:

    If we remove the bootstrap's class="form horizontal" from the form starting tag then the error will be removed and the submit button will work on the remote server as it was working on the local server.

    The error has something to do with the bootstrap. Although I am using the latest and same version bootstrap from a CDN in both the cases.