thedigicraft / Atom.CMS

Atom.CMS
56 stars 52 forks source link

Hello again, #245

Open saweetha opened 6 years ago

saweetha commented 6 years ago

I can't update the pages, whenever I try to update it, it's turning into new pages. I can't find out where things get wrong.

this is the index coding <?php

Start the session:

session_start();

if(!isset($_SESSION['username'])) { header('Location: login.php'); }

?>

<?php include('config/setup.php'); ?>

<!DOCTYPE html>

<?php echo $page['title'].'| '.$site_title; ?>

Admin Dashboard

Page was added!

'; } else { $message = '

Page could not be added because: '.mysqli_error($dcb); $message .= '

'.$q.'

'; } } ?>
"
creptor commented 6 years ago

Try replacing this: if(isset($_POST['id'])!='') { With this: if(isset($_POST['id'])&&$_POST['id']!='') {

saweetha commented 6 years ago

It's still adding new pages, not updating. Any source that i need to show more to make your work easy?

creptor commented 6 years ago

I found that your id input value doesn't have an = after value....

It shows like this <input type="hidden" name="id" value"<?php echo $opened['id']; ?>" And it should be like this <input type="hidden" name="id" value="<?php echo $opened['id']; ?>"


Also, if that doesn't work, check that opened is defined before everything please.