Error in error checking

4 posts by 2 authors in: Forums > CMS Builder
Last Post: December 12, 2011   (RSS)

Hi Guys,

If a leave a field blank in this form, I get the error alert, but I also get an error "Notice: Undefined variable: errorsAndAlerts in /home/askmatus/public_html/register.php on line 34 "

Can anyone help?

http://www.askmatusik.com/register.php
Cheers,

Tim (toledoh.com.au)
Attachments:

register.php 6K

Re: [Toledoh] Error in error checking

Hi All,

I think the issue is something to do with this;

$alertsAndErrors = "";
if (!@$_REQUEST['title']) { $alertsAndErrors .= "Please specify title!<br/>\n"; }
if (!@$_REQUEST['email']) { $errorsAndAlerts .= "You must enter your email!<br/>\n"; }
else if(!isValidEmail(@$_REQUEST['email'])) { $errorsAndAlerts .= "Please enter a valid email (example: user@example.com)<br/>\n"; }
if (!@$_REQUEST['content']) { $alertsAndErrors .= "Please ask your question!<br/>\n"; }


If I remove that check, the site performs fine (but doesn't check the email...)
Cheers,

Tim (toledoh.com.au)

Re: [Toledoh] Error in error checking

By Dave - December 12, 2011

Hi Tim,

Try replacing $alertsAndErrors with $errorsAndAlerts

Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com