thedigicraft / Atom.CMS

Atom.CMS
56 stars 52 forks source link

25 video series dynamic example #194

Closed bghodsi closed 7 years ago

bghodsi commented 7 years ago

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.

bghodsi commented 7 years ago

index.php -- admin <?php error_reporting(0) ; // setup document include('config/setup.php');

?> <!DOCTYPE html>

<?php //echo $page_title; ?> - ATOM.CMS
``` ```

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);
} 

?>

Blog Manager

echo "HERE";

pages.php

<?php ## page Manager ?>

Page Manager