my code is like this
if (isset(POST_[submit])){
......if (empty($name))
..........echo "name field is empty";
......else if(isset($_POST[submit])){
............$name = $_POST[name];
........query
........mysql_cuery($query,$conn)
}
}
if (isset(POST_[submit2])){
......if (empty($pet))
..........echo "pet field is empty";
......else if(isset($_POST[submit2])){
............$pet = $_POST[pet];
........query
........mysql_cuery($query,$conn)
}
}
As you can see I have two submit buttons submit1 and submit two.
When I submit with the first one and the text field is empty I expect to receive the echo like this:
name field is empty
but I get the result like this
name field is emptypet field is empty
My question is what is the reason for geting the two echos instead of one echo?