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
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: [Jeffncou] Using check box to hide form submitted by addForm.php
By Jason - October 1, 2010
Hi,
What you would need to do is to add to the SQL query that inserts the record into your database. What you would want to do is to set the value of your checkbox field (I'm assuming your using hidden) to 1 (this is the value of checked).
This should get you started. If you have any questions, let me know and attach addForm.php to this thread.
Thanks
What you would need to do is to add to the SQL query that inserts the record into your database. What you would want to do is to set the value of your checkbox field (I'm assuming your using hidden) to 1 (this is the value of checked).
This should get you started. If you have any questions, let me know and attach addForm.php to this thread.
Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
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
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