Hi, required some help from any gurus in php.
was trying to do a CMS admin page (deleting page), but seem to have a problem to delete or seem to call out GET id from the editcontent.php page. Appreciate anyone for help. Tks
Contentpage.
<?php
require_once "../dbConnect.php";
$query = "SELECT * FROM news_update";
$result = mysqli_query($redConnect, $query) or die(mysqli_error($redConnect));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CMS Edit/Delete Content</title>
<link href="stylesheet/adminStyle.css" rel="stylesheet" type="text/css" />
</head>
<body><?php include ("topBanner.php");?>
<div id="midContainer">
<div id="midLeftContainer">
Welcome Red Dynasty Administrator,
<div id="leftNav"> <?php include ("leftNav.php");?>
</div>
</div>
<div id="midRightContainer">
<table id = "showEdit" width = 100%;>
<tr><th width = "25%"><h2>Title</h3></th><th width = "60%"><h2>Content</h2></th><th width = "15%"><h2>Action</h2></th></tr>
<?php while ($row = mysqli_fetch_array($result)){
echo "<tr><td>";
echo $row['news_title'];
echo "</td><td>";
echo $row['news_content'];
echo "</td><td>";
echo '<a href="p_deleteContents.php?id=$row['news_id']">'.Delete.'[/url]</td></tr>';
}?>
</table>
</div>
</div>
<div id="clearBoth">
</div>
</body>
</html>
While this is the deletepage
<?php
$db_name = "database";
$db_server = "localhost";
$db_user = "root";
$db_pass = "";
$redConnect = mysqli_connect($db_server, $db_user, $db_pass, $db_name) or die(mysqli_error());
$id = $_GET['news_id'];
$esp_id = mysqli_real_escape_string($redConnect, $id);
$query = "DELETE FROM news_update WHERE news_id = '$esp_id'";
$result = mysqli_query($redConnect, $query) or die(mysqli_error($redConnect));
?>