Closed bghodsi closed 7 years ago
index.php -- admin <?php error_reporting(0) ; // setup document include('config/setup.php');
?> <!DOCTYPE html>
blog.php
<?php ## blog Manager ?> <?php if(isset ($_POST['submitted']) ==1){
if ($_GET['id'] == '') {
$date = $_POST['date'];
if ($date =='') { $date = date('Y-m-d H:i:s'); }
$q="INSERT INTO blog (title,date,body) VALUES( '$_POST[title]' , '$date','$_POST[body]' )";
}else{
$q="UPDATE blog SET title='$_POST[title]',date='$_POST[date]', body='$_POST[body]' WHERE id='$_POST[id]' ";
}
$r=mysqli_query($dbc,$q);
}
?>
pages.php
<?php ## page Manager ?>
Blog works just fine but when I click on any one of the titles the last record always pops on the right.
I am at the ends of my wits to resolve this issue.
Any suggestion will be helpful
Thanks.
PS I have learned a lot about dynamic php page by following your video tutorials.