TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ToBe
NA
164
94.2k
PHP Code
Jul 23 2013 7:16 AM
Hi everyone
I have this code and i want to validate the email :
it will always gives Internal Server error
help me please in this code :
<?php
/* send the submitted data */
$name=$_REQUEST['name'];
$email=$_REQUEST['email'];
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
$message=$_REQUEST['message'];
if (($name=="")||($email=="")||($message==""))
{
echo "All fields are required, please fill <a href=\"\">the form</a> again.";
}
elseif
(!preg_match($email_$_REQUEST['email']))
{
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
else {
$from="From: $name<$email>\r\nReturn-path: $email";
$subject="Message sent using your contact form";
mail("
[email protected]
", $subject, $message, $from);
echo "Email sent!";
}
?>
Reply
Answers (
1
)
How to make header, footer and index page in PHP
insert multiple checkbox into database in php