Modernvox Posted January 12, 2010 Share Posted January 12, 2010 Hi Guyz, Can anyone see this error in the code? Cause I've been looking for a while now. <?php if(isset($_POST['submit'])) if(isset($_POST['name'])) if(isset($_POST['address'])) $email = ($_POST['email']; $name = ($_POST['name']; $details = ($_POST['comments']; $pattern = '/^[a-z0-9]{4,}+.?([a-z0-9]+)?@([a-z0-9]+\.)+[a-z]{3,4}$/i'; if (preg_match($pattern, $email)) { echo "message here"; } else { echo "You have entered an invalid email address"; return 1; } $to = 'myaddress'; $subject = 'You have an affiliate inquiry'; $msg = "$name $email $details"; mail($to, $subject, $msg, 'From:' . $email); ?> Quote Link to comment https://forums.phpfreaks.com/topic/188149-unexpected-in-cxampphtdocsisingaffiliate_truephp-on-line-23-cant-find/ Share on other sites More sharing options...
oni-kun Posted January 12, 2010 Share Posted January 12, 2010 $email = ($_POST['email']; $name = ($_POST['name']; $details = ($_POST['comments']; Note something's up with the brackets? .. Quote Link to comment https://forums.phpfreaks.com/topic/188149-unexpected-in-cxampphtdocsisingaffiliate_truephp-on-line-23-cant-find/#findComment-993328 Share on other sites More sharing options...
Modernvox Posted January 12, 2010 Author Share Posted January 12, 2010 $email = ($_POST['email']; $name = ($_POST['name']; $details = ($_POST['comments']; Note something's up with the brackets? .. Nah...No matter what I do the error exists. Quote Link to comment https://forums.phpfreaks.com/topic/188149-unexpected-in-cxampphtdocsisingaffiliate_truephp-on-line-23-cant-find/#findComment-993332 Share on other sites More sharing options...
Lamez Posted January 12, 2010 Share Posted January 12, 2010 <?php $email = ($_POST['email']); //You forgot the ')' Duh! $name = ($_POST['name']); $details = ($_POST['comments']); ?> Quote Link to comment https://forums.phpfreaks.com/topic/188149-unexpected-in-cxampphtdocsisingaffiliate_truephp-on-line-23-cant-find/#findComment-993333 Share on other sites More sharing options...
Modernvox Posted January 12, 2010 Author Share Posted January 12, 2010 <?php $email = ($_POST['email']); //You forgot the ')' Duh! $name = ($_POST['name']); $details = ($_POST['comments']); ?> I tried all that already, it does nothing dude Quote Link to comment https://forums.phpfreaks.com/topic/188149-unexpected-in-cxampphtdocsisingaffiliate_truephp-on-line-23-cant-find/#findComment-993335 Share on other sites More sharing options...
Modernvox Posted January 12, 2010 Author Share Posted January 12, 2010 <?php $email = ($_POST['email']); //You forgot the ')' Duh! $name = ($_POST['name']); $details = ($_POST['comments']); ?> Damn...I am really am dumb as shit!!!! Thanks Guyz! Quote Link to comment https://forums.phpfreaks.com/topic/188149-unexpected-in-cxampphtdocsisingaffiliate_truephp-on-line-23-cant-find/#findComment-993337 Share on other sites More sharing options...
oni-kun Posted January 12, 2010 Share Posted January 12, 2010 <?php $email = ($_POST['email']); //You forgot the ')' Duh! $name = ($_POST['name']); $details = ($_POST['comments']); ?> Damn...I am really am dumb as shit!!!! Thanks Guyz! No problem! Just part of programming. I'd recommend you download an IDE for PHP (such as NetBeans), They're free and can list PHP errors, as well as highlight your code to show obvious syntax errors. Quote Link to comment https://forums.phpfreaks.com/topic/188149-unexpected-in-cxampphtdocsisingaffiliate_truephp-on-line-23-cant-find/#findComment-993340 Share on other sites More sharing options...
Modernvox Posted January 12, 2010 Author Share Posted January 12, 2010 <?php $email = ($_POST['email']); //You forgot the ')' Duh! $name = ($_POST['name']); $details = ($_POST['comments']); ?> Damn...I am really am dumb as shit!!!! Thanks Guyz! No problem! Just part of programming. I'd recommend you download an IDE for PHP (such as NetBeans), They're free and can list PHP errors, as well as highlight your code to show obvious syntax errors. Will do. TY Quote Link to comment https://forums.phpfreaks.com/topic/188149-unexpected-in-cxampphtdocsisingaffiliate_truephp-on-line-23-cant-find/#findComment-993343 Share on other sites More sharing options...
Lamez Posted January 12, 2010 Share Posted January 12, 2010 Notepad++ is good as well, it is very lightweight. Quote Link to comment https://forums.phpfreaks.com/topic/188149-unexpected-in-cxampphtdocsisingaffiliate_truephp-on-line-23-cant-find/#findComment-993364 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.