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); ?> 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? .. 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. 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']); ?> 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 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! 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. 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 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. 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
Archived
This topic is now archived and is closed to further replies.