ggp
03-07-2007, 06:23 PM
Hi.
Could you help me plzz?
This code is not doing the cicle properly it is not going into the else to inserting the data in the db and to validate the email.
Thanks for any help
<?php
include 'global2.php';
if (isset($_POST['submit'])) {
//perform any error checking on incoming data
if (empty($name) || empty($email) || empty($subject) || empty($message)){
echo "**** .";
exit();
}
else {
if (!empty($_POST['image_id']))
{}
else
{
$date=time();
mysql_query("INSERT INTO contactus (name, email, subject, message) VALUES('{$_POST['name']}', '{$_POST['email']}' , '{$_POST['subject']}', '{$_POST['message']}')");
$message = 'Thank You for your email will be in touch with you shortly';
}
?>
<?if (isset($****)) print $****>
<?php
$from = $_REQUEST['****'];
// is the $from email address in valid format?
if(eregi("( )", $from)) {
print $name;
print $email;
print $subject;
} else {
print("Sorry, this email address: doesn't seem to be in the right format.");
}
}
}
?>
Could you help me plzz?
This code is not doing the cicle properly it is not going into the else to inserting the data in the db and to validate the email.
Thanks for any help
<?php
include 'global2.php';
if (isset($_POST['submit'])) {
//perform any error checking on incoming data
if (empty($name) || empty($email) || empty($subject) || empty($message)){
echo "**** .";
exit();
}
else {
if (!empty($_POST['image_id']))
{}
else
{
$date=time();
mysql_query("INSERT INTO contactus (name, email, subject, message) VALUES('{$_POST['name']}', '{$_POST['email']}' , '{$_POST['subject']}', '{$_POST['message']}')");
$message = 'Thank You for your email will be in touch with you shortly';
}
?>
<?if (isset($****)) print $****>
<?php
$from = $_REQUEST['****'];
// is the $from email address in valid format?
if(eregi("( )", $from)) {
print $name;
print $email;
print $subject;
} else {
print("Sorry, this email address: doesn't seem to be in the right format.");
}
}
}
?>