Solution 1 :

try to add an id to each form. and change

<input type="submit" name="" value="">


<button type="button" onClick="test()">Submit</button>


<h3>Delete a student</h3>
<form id="deleteStudent" method="post" action="connect.php">
ID : <input type="text" name="id"><br><br>
<button type="button" onClick="test()">Submit</button>

last add javascript

    function tes(){

Solution 2 :

You cannot have nested forms. Please close your forms properly and retry

Solution 3 :

Found the issue, at the advice of Quentin, I used I came to the conclusion based on the information I drew that I was missing a closing tag for two form elements. I would mark this as solved but stackoverflow won’t let me for two days 🙁

Problem :

I am running into a strange error on a website using multiple PHP scripts. For some reason, every submit button only calls the first PHP script defined rather than the one chosen. I know all of these scripts work and this issue started only recently. Here is the code in question:

<!DOCTYPE html>
    <title>Embed PHP in a .html File</title>
    <form action="index.php">
        <button type="gohome">Return to main form</button>
    <h3>WIP Final results:</h3>
    <form method="post" action="clearFinal.php">
    <input type="submit" name="clearFinal" value="Clear Responses">
    <form method="post" action="resetFinal.php">
    <input type="submit" name="resetFinal" value="Reset ID Count">
    <h3>Students names</h3>
    <h3>Add a Student</h3>
    <form method="post" action="addstudent.php">
    Student Name : <input type="text" name="studentname"><br><br>
    <input type="submit" name="addstudent" value="Submit">
    <h3>Delete a student</h3>
    <form method="post" action="connect.php">
    ID : <input type="text" name="id"><br><br>
    <input type="submit" name="removeStudent" value="Submit">

I have tried changing some of the names for the buttons to make sure there was not a conflict but that did not make any different. Any info on this issue will help, thanks!


Comment posted by

Comment posted by David

Typo? You forgot to close some of the

Comment posted by Mr Buddyboi

I am invoking all of them individually through a button but what is happening is that every button just triggers the same form.

Comment posted by Quentin

@MrBuddyboi — Why are you making a comment repeating what you said in the first paragraph of your question instead of addressing the issues raised in other people’s comments?

Comment posted by zkanoca

This is not answer. You could have written this post as comment at the bottom of the question.

Comment posted by edit

Your answer could be improved with additional supporting information. Please