PHP Header Function | Tutorial

Опубликовано: 15 Октябрь 2024
на канале: YouAccel
47
0

Course Title: Web Development Masterclass
Course Link: http://youaccel.com/admin/cdisplay.ph...

Facebook:   / youaccel  
Twitter:   / youaccel  
Website: http://youaccel.com

Tutorial Contents:

In the previous lesson, we deleted records from our database using the SQL DELETE statement.

As you can see, once the record is deleted, a success message is displayed and we have to press the back button to go back to our main page.

We can make the process more seamless, by placing an automatic redirect once the record has been deleted.

This can be done using the header() function.

The header() function sends a raw HTTP header to a client.

Replace your echo statement, in the deluser.php file with the following syntax:

header("location:delete.php");

Here, we've instructed the header function to go back to the delete.php page once the record has been deleted.