Forum Moderators: coopster
<snip>
The reason I ask is because say for instance some commercial CMS systems allow only so many pages total for a certain price...greater than that a little more and so on. There has to be a way to limit the entries. Any help is appreciated.
Brad
[edited by: eelixduppy at 7:20 am (utc) on Sep. 29, 2007]
[edit reason] removed url [/edit]
<?php
require_once "validator_file.php";
if ($HTTP_POST_VARS){
$validator = new Validator();
$validator->validateGeneral($HTTP_POST_VARS['page_no'], EDITOR_PAGE_NO);
$validator->validateGeneral($HTTP_POST_VARS['title'], EDITOR_CATEGORY_TITLE);
$validator->validateGeneral($HTTP_POST_VARS['fckeditor'], EDITOR_CONTENT);
if ( $validator->foundErrors() ){
echo '<b style="color:#C92E2A; font-size:12px;"> '. ERROR_PLEASE_INSERT .' </b> <br /><i>'.$validator->listErrors('<br>').'</i><br><br />';
}else{
//database_connect();
[b]$insert = "INSERT INTO
category (title, text, keywords, metaDesc, robots, box1, box2, page_no)
VALUES ('$title', '$fckeditor', '$keywords', '$metaDesc', '$robots', '$box1', '$box2', '$page_no')";[/b]
if ($query3 = mysql_query($insert) or die(mysql_error())){
echo '<b> '. DATABASE_SUCCESS .' </b><br><br>';
}else{
echo('<p>MySQL Error #' . mysql_errno() . '</b><br>' . mysql_error() .'</p>');
}
}
}
?>
For instance...if the CMS system only allows a total of 10 pages to be added, and there are currently 10 pages...when the user goes to add the 11th page they will get an error saying something like "No more pages can be added at this time". Not sure how to create this in php...any ideas?