Open ghost opened 10 years ago
I am able to edit a page, not problem, but cannot add a new page
are you not getting an error message? (btw you can simply copy/paste the code in the message instead of screenshots - its easier for me to review and test)
Seems like the id for a new page is not passed on, because the query in the screenshot says WHERE id=''. And another issue is that you are not updating an existing page, but inserting a new page. This choice is made in the file queries.php. Look up the rule if (isset($_POST['id']) != ''){ and change it into if (isset($_POST['id']) AND $_POST['id'] != '') { Then it should work. The id-field is not defined when it reloads when you click on save, so if you your errors are still turned on, you get a notice, but it works! I beleive it will be solved in another lesson.
mcduck thank you sir
Well i followed Mc Duck74's tip and everything seems to have passed thrue exept for
Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in /home/a9667120/public_html/admin/index.php on line 143
wich on my code is the line where we added:
<input type="hidden" name="id" value="<?php echo $opened['id']; ?>">
And for the life of me i cant figure out why it wont find $opened!!
Some one plz...
I am sorry I haven't answered you for so long. A lot of other work made that I had no more time to look at it. When I had more time, this question was sadly forgotten. I read your question again and tried to restart my own project. Sadly I came up with the same error and could not solve it either, yet. I hope someone has a solution.
Oh god, still haven't found the issue????.... it's so simple man, I just thought you were over with this...
Just change the value of the id in the UPDATE sql to $_POST[id]
(-> instead of $_GET[id]
).
you were checking for a $_POST['id']
in the if statement so...
McDuck74, your solution seems to have fixed my issue - see https://github.com/thedigicraft/Atom.CMS/issues/170
Thanks, I can now edit a page but also add a page
Here is the pic of the error, when i try to add new page:
Here is the queries.php code: and the cut out part: