delete.php
changeset 0 a4bc6ef5dbfe
child 1 29ae580f12bd
equal deleted inserted replaced
-1:000000000000 0:a4bc6ef5dbfe
       
     1 <?php
       
     2 	// get request ID to delete
       
     3 	$req_ID = $_GET['req_id'];
       
     4 	
       
     5 	$conn = mysql_connect('localhost','root','') or die(mysql_error());
       
     6 	mysql_select_db('h4c_db');
       
     7 	
       
     8 	// retrieve cookie if it exists
       
     9 	if ($req_ID != "") 
       
    10 	{	
       
    11 		$query = mysql_query("DELETE FROM requests_tbl WHERE (req_ID = '$req_ID')");
       
    12 		header ('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/details.php?alert=del');
       
    13 	} 
       
    14 	
       
    15 	mysql_close();
       
    16 ?>
       
    17 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
       
    18 <html xmlns="http://www.w3.org/1999/xhtml">
       
    19 <head>
       
    20 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
       
    21 <title>H4C - deleting request information...</title>
       
    22 <link href="files/h4c_main.css" rel="stylesheet" type="text/css" media="screen" />
       
    23 </head>
       
    24 
       
    25 <body>
       
    26 <?php
       
    27 	// FOR TEST PURPOSES - CHECK QUERYSTRING
       
    28 	//print "req id = " . $req_ID;
       
    29 	
       
    30 	if ($req_ID == "") 
       
    31 	{
       
    32 		print "The search item you requested to delete does not exist. Click the link to return to the <a href='details.php'>search page</a>.";
       
    33 	}
       
    34 ?>
       
    35 </body>
       
    36 </html>