AutoPulse v 1.0.1
 
Loading...
Searching...
No Matches
C:/Users/ivans/OneDrive/Документы/ZWA/sem/delete_insertion.php File Reference

This script handles the deletion of the particular insertion from the database by website admins or insertion owners. More...

Functions

 terminateDeclineAdminWithError ($errorParam)
 

Variables

if(isset($error)) try
 

Detailed Description

This script handles the deletion of the particular insertion from the database by website admins or insertion owners.

Connects to the database, deletes the record of a particular id provived as GET request parameter from the 'insertions' table. Redirects to the main page. Terminates in case of connection- or update- error and redirects to the main page with an error context info as a parameter of the redirecting GET request.

Function Documentation

◆ terminateDeclineAdminWithError()

terminateDeclineAdminWithError ( $errorParam)

Redirects the user to a specified location with an error parameter.

Parameters
string$errorParamThe error parameter to append to the URL.

Handles PDO exceptions by redirecting with an error parameter.

Variable Documentation

◆ try

if (isset( $error)) try
Initial value:
{
$stmt = $pdo->prepare("
UPDATE users
SET
admin_requested = 0
WHERE id = :id
")
if(! $user) catch(PDOException $e) $pdo
Definition myprofile.php:59
if(! $userExists) $stmt
Definition process-accountDelete.php:48

Checks if an error occurred during database connection and redirects with an error parameter.