Search the Community
Showing results for tags 'chapter 5'.
-
On page 124 it says you can use sql commands from your website to populate the database. But the sql commands I got from the download don't have any sample content, all that is in the sql commands is the commands to add the tables to the database. No content. Where can I get the file with the data to populate the tables. Please indicate the url where I can download that. I am trying to populate the pages myself but I keep getting the error which says Please select a category! I added 2 numeric categories to the categories table, but the form still won't accept it. There seems to be a problem with the code of the select menu. I could really use some help with this part of the book. Some help would be appreciated.
-
Hello again. Problem: Every time I am logged in as administrator to add content, it doesn't allow me to submit the "Add This Page". Instead, it keeps asking me to "Please select a category!" - which I have. Current code I am using for 'validating category' (as on page 109) if (filter_var($_POST['category'], FILTER_VALIDATE_INT, array('min_range' => 1))) { $cat = $_POST['category']; } else { // No category selected. $add_page_errors['category'] = 'Please select a category!'; } What I have tried I have tried the other variation of: if (isset($_POST['category'] && (int) $_POST['category'] >= 1)) { $cat = $_POST['category']; } else { // No category selected. $add_page_errors['category'] = 'Please select a category!'; } But this keeps on sending me the error on the line. What do you think I should do? Many thanks
- 11 replies
-
- chapter 5
- add_page.php
-
(and 1 more)
Tagged with: