Now that we've set up our web page so it redirects back to the main page we might want to display a
success message letting the user know the record has been successfully deleted to do this.
We need to pass a variable back to the main page in our world.
After the read after the redirection call this variable message and set the value to delete.
So this is on the DL user P HP page in the header function.
Add the following to your you URL so we're gonna go back to do we thought HP page after the record has
been deleted and we're also sending a variable with the value equal to delete
in your delete IP HP page.
We'll need to create an if statement and it should look like this.
You can put it directly above your as you will query
inside this if statement we need to check if the variable message is not.
No we can do this using the ISAT function and get method.
So here we're checking to see if there is a value attached to the variable message.
And the only way there would be a variable sorry of value attached to it is if it was sent back in our
redirect
so if the variable message is not.
The next thing we need to do is actually find out the value of the variable message so create another
if statement.
To check the value to see if it is equal to delete So remember we're sending the value back as delete
if the value is delete we're going to echo a success message.
So record deleted and that's it.
Now we can go ahead and test our script.
I'll go ahead and delete record with the idea.
Thirty seven and we can see that the record was deleted in a success message is also visible and you
can see in the URL that the variable message passed along a variable pass along the value to meet inside
the URL.