From: Don Wieland on 13 Jun 2010 09:43 Hello, I have a contact form with three fields, name, email, and comment, and a CAPTCHA I am doing some basic validation for empty fields but am getting a PHP error when trying to redirect back to the original page with an ERROR, It seems when my COMMENT field contains <BR>s, it generates the PHP ERROR. No <BR?s works perfectly. Am I missing a function for the comment that is necessary for the GET STRING return? if($_POST['name'] AND $_POST['email'] AND $_POST['comment']) { }else{ header("location: contactus.php?Error=Missing values in REQUIRED FIELDS&name=".$_POST['name']."&email=".$_POST['email']."&comment=". $_POST['comment']); exit(); } session_start(); if($_SESSION['Captcha_Str'] != $_POST['scode']) { echo "HI"; header("location: contactus.php?Error=You did not enter your SECURITY CODE correctly. It is case sensitive.&name=".$_POST['name']."&email=". $_POST['email']."&comment=".$_POST['comment']); exit(); } Don Wieland D W D a t a C o n c e p t s ~~~~~~~~~~~~~~~~~~~~~~~~~ donw(a)dwdataconcepts.com Direct Line - (949) 305-2771 Integrated data solutions to fit your business needs. Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at: http://www.dwdataconcepts.com/DevSup.html Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher http://www.appointment10.com For a quick overview - http://www.appointment10.com/Appt10_Promo/Overview.html
From: Ashley Sheridan on 13 Jun 2010 10:21 On Sun, 2010-06-13 at 06:43 -0700, Don Wieland wrote: > Hello, > > I have a contact form with three fields, name, email, and comment, and > a CAPTCHA > > I am doing some basic validation for empty fields but am getting a PHP > error when trying to redirect back to the original page with an ERROR, > > It seems when my COMMENT field contains <BR>s, it generates the PHP > ERROR. No <BR?s works perfectly. Am I missing a function for the > comment that is necessary for the GET STRING return? > > if($_POST['name'] AND $_POST['email'] AND $_POST['comment']) { > }else{ > header("location: contactus.php?Error=Missing values in REQUIRED > FIELDS&name=".$_POST['name']."&email=".$_POST['email']."&comment=". > $_POST['comment']); > exit(); > } > > > session_start(); > > > > if($_SESSION['Captcha_Str'] != $_POST['scode']) { > echo "HI"; > header("location: contactus.php?Error=You did not enter your SECURITY > CODE correctly. It is case sensitive.&name=".$_POST['name']."&email=". > $_POST['email']."&comment=".$_POST['comment']); > exit(); > } > > > Don Wieland > D W D a t a C o n c e p t s > ~~~~~~~~~~~~~~~~~~~~~~~~~ > donw(a)dwdataconcepts.com > Direct Line - (949) 305-2771 > > Integrated data solutions to fit your business needs. > > Need assistance in dialing in your FileMaker solution? Check out our > Developer Support Plan at: > http://www.dwdataconcepts.com/DevSup.html > > Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro > 9 or higher > http://www.appointment10.com > > For a quick overview - > http://www.appointment10.com/Appt10_Promo/Overview.html > What exactly is the error you're seeing? Thanks, Ash http://www.ashleysheridan.co.uk
From: Ashley Sheridan on 13 Jun 2010 10:53 On Sun, 2010-06-13 at 07:50 -0700, Don Wieland wrote: > Yeah - I thought about that, but I don't know how to do this. I have a > partner who admins my virtual private server. Oh well ;-) > > > > It is probably something I need to do to the header() string to > accommodate the <BR>s. I am redirecting back to the original form, > displaying an ERROR, then re-populating the fields via the GET string. > The omission of this is CHOKING PHP. > > > > Don > > > On Jun 13, 2010, at 7:39 AM, Ashley Sheridan wrote: > > > > > Turn on display_errors in your php.ini, or read the error log. That > > will show you exactly what your error is, and then if you don't know > > how to fix that error, post it back here. > > > > Don Wieland > D W D a t a C o n c e p t s > ~~~~~~~~~~~~~~~~~~~~~~~~~ > donw(a)dwdataconcepts.com > Direct Line - (949) 305-2771 > > > Integrated data solutions to fit your business needs. > > > Need assistance in dialing in your FileMaker solution? Check out our > Developer Support Plan at: > http://www.dwdataconcepts.com/DevSup.html > > > Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro > 9 or higher > http://www.appointment10.com > > > > For a quick overview - > > http://www.appointment10.com/Appt10_Promo/Overview.html > > > Add a line in to your .htaccess file then to turn error displaying on. Note that if this is a live server then you shouldn't really do this, but if you have to, turn them back off again asap. php_flag display_errors off ps. please keep the list copied in, as other people might be able to benefit from the thread. psps. please try not to top post; every time you do, a kitten dies ;) Thanks, Ash http://www.ashleysheridan.co.uk
From: Don Wieland on 13 Jun 2010 11:06 On Jun 13, 2010, at 7:53 AM, Ashley Sheridan wrote: > On Sun, 2010-06-13 at 07:50 -0700, Don Wieland wrote: > >> Yeah - I thought about that, but I don't know how to do this. I >> have a >> partner who admins my virtual private server. Oh well ;-) >> >> >> >> It is probably something I need to do to the header() string to >> accommodate the <BR>s. I am redirecting back to the original form, >> displaying an ERROR, then re-populating the fields via the GET >> string. >> The omission of this is CHOKING PHP. >> >> >> >> Don >> >> >> On Jun 13, 2010, at 7:39 AM, Ashley Sheridan wrote: >> >> >> >>> Turn on display_errors in your php.ini, or read the error log. That >>> will show you exactly what your error is, and then if you don't know >>> how to fix that error, post it back here. >> >> >> >> Don Wieland >> D W D a t a C o n c e p t s >> ~~~~~~~~~~~~~~~~~~~~~~~~~ >> donw(a)dwdataconcepts.com >> Direct Line - (949) 305-2771 >> >> >> Integrated data solutions to fit your business needs. >> >> >> Need assistance in dialing in your FileMaker solution? Check out our >> Developer Support Plan at: >> http://www.dwdataconcepts.com/DevSup.html >> >> >> Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro >> 9 or higher >> http://www.appointment10.com >> >> >> >> For a quick overview - >> >> http://www.appointment10.com/Appt10_Promo/Overview.html >> >> >> > > Add a line in to your .htaccess file then to turn error displaying on. > Note that if this is a live server then you shouldn't really do this, > but if you have to, turn them back off again asap. > > php_flag display_errors off > When I look at my FTP client, I cannot see this .htaccess file. This is a live server, so I am hesitant to find it anyways. I will wait for my partner to assist me with this config so I can see the error. Unless someone know what I am missing by description. We'll see ;-) > ps. please keep the list copied in, as other people might be able to > benefit from the thread. > OOPS! Sorry, we'll do from now on. Don
From: Ashley Sheridan on 13 Jun 2010 11:11
On Sun, 2010-06-13 at 08:06 -0700, Don Wieland wrote: > On Jun 13, 2010, at 7:53 AM, Ashley Sheridan wrote: > > > On Sun, 2010-06-13 at 07:50 -0700, Don Wieland wrote: > > > >> Yeah - I thought about that, but I don't know how to do this. I > >> have a > >> partner who admins my virtual private server. Oh well ;-) > >> > >> > >> > >> It is probably something I need to do to the header() string to > >> accommodate the <BR>s. I am redirecting back to the original form, > >> displaying an ERROR, then re-populating the fields via the GET > >> string. > >> The omission of this is CHOKING PHP. > >> > >> > >> > >> Don > >> > >> > >> On Jun 13, 2010, at 7:39 AM, Ashley Sheridan wrote: > >> > >> > >> > >>> Turn on display_errors in your php.ini, or read the error log. That > >>> will show you exactly what your error is, and then if you don't know > >>> how to fix that error, post it back here. > >> > >> > >> > >> Don Wieland > >> D W D a t a C o n c e p t s > >> ~~~~~~~~~~~~~~~~~~~~~~~~~ > >> donw(a)dwdataconcepts.com > >> Direct Line - (949) 305-2771 > >> > >> > >> Integrated data solutions to fit your business needs. > >> > >> > >> Need assistance in dialing in your FileMaker solution? Check out our > >> Developer Support Plan at: > >> http://www.dwdataconcepts.com/DevSup.html > >> > >> > >> Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro > >> 9 or higher > >> http://www.appointment10.com > >> > >> > >> > >> For a quick overview - > >> > >> http://www.appointment10.com/Appt10_Promo/Overview.html > >> > >> > >> > > > > Add a line in to your .htaccess file then to turn error displaying on. > > Note that if this is a live server then you shouldn't really do this, > > but if you have to, turn them back off again asap. > > > > php_flag display_errors off > > > > When I look at my FTP client, I cannot see this .htaccess file. This > is a live server, so I am hesitant to find it anyways. I will wait for > my partner to assist me with this config so I can see the error. > > Unless someone know what I am missing by description. We'll see ;-) > > > > ps. please keep the list copied in, as other people might be able to > > benefit from the thread. > > > > OOPS! Sorry, we'll do from now on. > > Don If the file doesn't exist you can make it. Some FTP clients may hide the file as it begins with a period. By default, this character is used to hide files on *nix-based systems. Windows tends to choke every now and again on .htaccess files, as it sees it as a file with no name and just an extension. You mentioned that there were newline characters in the URL you were attempting to redirect to. URLs can't contain newline characters, so that could be causing it to choke. If in doubt, put the URL into a string first and echo that out and see what the result is. You may need to view the source of the output in your browser, as the browser will be treating that string as HTML by default, which treats whitespace differently. Thanks, Ash http://www.ashleysheridan.co.uk |