Closed Th3-Gh057 closed 5 years ago
Hey @Th3-Gh057, I think the problem has something to do with the $opened['id'] variable. Please check what value it has (when editing a page), and before clicking update.
Please check the value of the input id.
(this line: <input type="hidden" id="id" value="<?php echo $opened['id']; ?>">
)
Please use var_dump($opened)
and send the response given by the server.
Thank you @creptor for your instant answers to my issue. I tried to observe the value for $opened['id] variable but it gives me an headache.. I have no enough php knowledges, I am at the beginning, this is why I wanted to learn from thedigicraft which is awesome.. I executed var_dump($opened) and I received this:
array(9) { ["id"]=> string(1) "1" ["user"]=> string(1) "1" ["slug"]=> string(4) "home" ["label"]=> string(4) "Home" ["title"]=> string(9) "Home Page" ["header"]=> string(21) "Welcome to DynaCoPlat" ["body"]=> string(3067)
Before I clicked update from the debug I received this:
[opened] => Array ( [id] => 1 [user] => 1 [slug] => home [label] => Home [title] => Home Page [header] => Welcome to DynaCoPlat [body] =>
After I clicked update debug shows these informations:
( [_GET] => Array ( [page] => pages [id] => 1 )
[_POST] => Array
(
[title] => Home Page1
[user] => 1
[slug] => home
[label] => Home
[header] => Welcome to DynaCoPlat
[body] =>
[submitted] => 1 ) [action] => added [q] => SELECT id FROM users ORDER by first ASC [r] => mysqli_result Object ( [current_field] => 0 [field_count] => 1 [lengths] => [num_rows] => 7 [type] => 0 )
[message] =>
Page was added!
[opened] => Array
(
[id] => 1
[user] => 1
[slug] => home
[label] => Home
[title] => Home Page
[header] => Welcome to DynaCoPlat
[body] =>
If these results are not enough, you can please give me some directions how to check the values for $opened['id'] variable. Thank you so much for your support..
Issue was resolved, the error was on line:
<input type="hidden" id="id" value="<?php echo $opened['id']; ?>">
Where id="id" it was supposed to be name="id".
Thank you for your support.
Nice catch, sry for not being able to help in time. I have a lot stuff to do on the week 😅.
If you have any other problems, want some advice or information don't hesitate and post it here, I'll try to help you.
For couple of days I have an error on my admin page, if I want to update the title or anything from an existing page when I hit the save button, the page is not updating but it create a new one with the same content as the existing one and instead of 'page was update' message I receive 'page was added' .. I put here queries.php and pages.php in the case someone can help me with this issue, thanks
queries.php
Page Manager