Re: [PHP] questions about if statements regarding a checkbox

2010-10-31 Thread a...@ashleysheridan.co.uk
What is the code you're using now? You have a syntax error, but without seeing the code, we are all left to guessing what the problem could be. Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: Ben Brentlinger b...@benbrent.com Date: Sun, Oct 31, 2010 03:56 Subject:

Re: [PHP] questions about if statements regarding a checkbox

2010-10-31 Thread Andre Polykanine
Hello Ben, You should use isset: if (isset($_POST['check'])) { // The checkbox is checked } else { // It's unchecked } -- With best regards from Ukraine, Andre Skype: Francophile Twitter: http://twitter.com/m_elensule Facebook: http://facebook.com/menelion - Original message - From:

Re: [PHP] questions about if statements regarding a checkbox

2010-10-31 Thread Ben Brentlinger
Here's the code I'm using with the exception of the php tags and the redirect script that redirects to another page once the form is submitted. This is just a test script I'm working on in order to teach myself php. The php portion will be posted first, than the html form related to the php.

RE: [PHP] questions about if statements regarding a checkbox

2010-10-31 Thread admin
Subject: Re: [PHP] questions about if statements regarding a checkbox Here's the code I'm using with the exception of the php tags and the redirect script that redirects to another page once the form is submitted. This is just a test script I'm working on in order to teach myself php. The php

RE: [PHP] questions about if statements regarding a checkbox

2010-10-31 Thread admin
...@buskirkgraphics.com] Sent: Sunday, October 31, 2010 10:37 AM To: 'Ben Brentlinger'; php-general@lists.php.net Subject: RE: [PHP] questions about if statements regarding a checkbox I tested your code and besides adding a form to the beginning it works. If you want to see the results

Re: [PHP] questions about if statements regarding a checkbox

2010-10-31 Thread tedd
At 10:05 PM -0400 10/30/10, Ben Brentlinger wrote: hello, I'd like to know the proper code to use in a php script that processes a form with a checkbox in order to send one email if the checkbox has been checked and another email if the checkbox hasn't. I tried if($check == true) and I tried

Re: [PHP] questions about if statements regarding a checkbox

2010-10-31 Thread Ben Brentlinger
thanks for your help. I just retested my code and even though it didn't work, I found the reason it wasn't working was because I had an unneeded space between the if and the rest of the if statement. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] questions about if statements regarding a checkbox

2010-10-31 Thread Ben Brentlinger
someone had responded with the isset if(isset($_POST['reallife'])) { print_r($_POST); } Richard L. Buskirk -Original Message- From: Ben Brentlinger [mailto:b...@benbrent.com] Sent: Sunday, October 31, 2010 8:26 AM To: php-general@lists.php.net Subject: Re: [PHP] questions about

Re: [PHP] questions about if statements regarding a checkbox

2010-10-30 Thread Adam Richardson
On Sat, Oct 30, 2010 at 10:05 PM, Ben Brentlinger b...@benbrent.com wrote: hello, I'd like to know the proper code to use in a php script that processes a form with a checkbox in order to send one email if the checkbox has been checked and another email if the checkbox hasn't.  I tried

RE: [PHP] questions about if statements regarding a checkbox

2010-10-30 Thread admin
input type=checkbox name=test If check it will submit the value of 'on' So If($_POST['test'] == on') { Do this }else{ Do this } Richard L. Buskirk -Original Message- From: Ben Brentlinger [mailto:b...@benbrent.com] Sent: Saturday, October 30, 2010 10:05 PM To:

Re: [PHP] questions about if statements regarding a checkbox

2010-10-30 Thread Bastien
On 2010-10-30, at 10:28 PM, ad...@buskirkgraphics.com wrote: input type=checkbox name=test If check it will submit the value of 'on' So If($_POST['test'] == on') { Do this }else{ Do this } Richard L. Buskirk -Original Message- From: Ben Brentlinger

Re: [PHP] questions about if statements regarding a checkbox

2010-10-30 Thread Ben Brentlinger
I tried that, but I'm getting the syntax error that says unexpected T_IF. Probably because I'm trying to process this information directly in an email rather letting a mysql database handle the data, which I find harder to set up when writing a script from scratch than it would be to code a