Using check box to hide form submitted by addForm.php

3 posts by 2 authors in: Forums > CMS Builder
Last Post: October 1, 2010   (RSS)

By JeffC - October 1, 2010

I have a section on my site where users can submit a review via addForm.php

I would like an opportunity to read the review before it goes live.

Within CMS Builder I have created a checkbox that hides an entry when checked. By default the box is unchecked so that all entries are shown by default.

How would I make an entry submitted by addForm.php CHECKED by default so that all entries submitted by the form remain undisplayed until I have a chance to review them?

Thanks
Jeff

Re: [Jason] Using check box to hide form submitted by addForm.php

By JeffC - October 1, 2010

Thanks, that sorted it.

To expand on Jasons advice I added hidden = '1', to the SQL query

Here is the code in full

if (!@$errorsAndAlerts) {
mysql_query("INSERT INTO `{$TABLE_PREFIX}reader_recommendations` SET
title = '".mysql_real_escape_string( $_REQUEST['title'] )."',
first_name = '".mysql_real_escape_string( $_REQUEST['first_name'] )."',
email = '".mysql_real_escape_string( $_REQUEST['email'] )."',
review = '".mysql_real_escape_string( $_REQUEST['review'] )."',
newsletter_sign_up = '".(@$_REQUEST['newsletter_sign_up'] ? '1' : '0')."',

hidden = '1',
createdDate = NOW(),
updatedDate = NOW(),
createdByUserNum = '0',
updatedByUserNum = '0'")
or die("MySQL Error Creating Record:<br/>\n". htmlspecialchars(mysql_error()) . "\n");
$recordNum = mysql_insert_id();

Jeff