I have this code:
echo'<form method="POST" action="">';
echo'Code:<input type="text" name="name">';
echo'<input type="submit" name="save" value="Save">';
echo'</form>';
if(isset($_POST['save'])){
//something
echo'<form method="POST" action="">';
echo'Code:<input type="text" name="name">';
echo'<input type="submit" name="delh" value="Delete">';
echo'</form>';
if(isset($_POST['delh'])){
// Cant show this! :(
echo "Deleted!";
}
}
When i press "DELETE", the page reloads and the message "Deleted!" remains hidden.
This is a schedule. The idea is if someone presses the Save button but has already saved an hour it says "You have already saved an hour, do you want to cancel it?". When it clicks "Delete", the hour is deleted from the database.
In the case where the Save button is pressed, but the person has not saved an hour, the delete button is not displayed.