FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


PlusContact 1.4





DanielXP
This send page just keeps saying

Message Not Sent!

Powered by RMB Scripts

What is wrong with it?

Code:
<?php
session_start();
?>
<HTML>
<HEAD>
<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">
</HEAD>
<BODY>
<?php
$errors=0;
if(isset($_POST['Submit']))
{
$number = $_POST['number'];
if(md5($number) != $_SESSION['image_value'])
echo 'Verification rejected please try again!';
else
{

if(isset($_POST['submit'])) {
$to = "YOUR-EMAIL-HERE"; 
$name_field = $_POST['name'];
$subject_field = $_POST['subject'];
$email_field = $_POST['email'];
$message = $_POST['message'];
$ip = getenv("REMOTE_ADDR");


$body = "From: $name_field\n E-Mail: $email_field\n IP: $ip\n Message:\n $message";
 
echo "Thank You $name_field. Your Message Has Been Sent.)";
mail($to, $subject_field, $body, "From: $email_field\r\nReply-to: $email_field\r\n");
} else {
echo "Message Not Sent!";
}

}
}
?>

<br>
<p><font face="Arial">Powered by RMB Scripts</font></p>


EDIT: The send page is this below

Code:
<form method="POST" action="send.php">
   Name:
   <input type="text" name="name" size="19"><br>
   <br>
   Email:
   <input type="text" name="email" size="26"><br>
   <br>
   Subject:
   <input type="text" name="subject" size="26"><br>
   <br>Message:<br>
   <textarea rows="9" name="message" cols="30"></textarea>
   <br>
   <br>Image Verification:<br><img src="random_image.php"><br><input name="number" type="text" id=\"number\" size="20">

   <br><br>
   <input name="Submit" type="submit" value="Submit">
   <input type="reset" value="Reset" name="reset"></form>


   

</body>

</html>
mathiaus
rather strange if statement you have. if $post isset twice - poinless! Then if not set show message not sent, crazy Shocked

Code:
<?php
$errors=0;
if(isset($_POST['Submit'])) {
   $number = $_POST['number'];
   if(md5($number) != $_SESSION['image_value']) {
      echo 'Verification rejected please try again!';
   } else {
      $to = "YOUR-EMAIL-HERE";
      $name_field = $_POST['name'];
      $subject_field = $_POST['subject'];
      $email_field = $_POST['email'];
      $message = $_POST['message'];
      $ip = getenv("REMOTE_ADDR");
      $body = "From: $name_field\n E-Mail: $email_field\n IP: $ip\n Message:\n $message";
      
      if(mail($to, $subject_field, $body, "From: $email_field\r\nReply-to: $email_field\r\n")) {
         echo "Thank You $name_field. Your Message Has Been Sent.";
      } else {
         echo "Message Not Sent!";
      }
   }
}
?>
BlackSkad
In the second check for the submit-button, you check $_POST['submit'] while the button is called 'Submit'. But in fact, as Mathiaus said, the second check for the submit-button is rather useless.
DanielXP
Thanks just put a

<?php
session_start();
?>

at the top and worked fine Very Happy
Related topics
Install Mambo 4.5.2 And Vbulletin 3.0.7
Download IPB 2.0.4
A new movie....Harry Potter 4...
4 humors
nice background effect
Fantastic 4
Worms 4: Mayhem
Gran Turismo 4
How To Make A Mini-Image for safedisc 4
Resident Evil 4 can a 11 or 12 yearold play
Help : Fedora Core 4 + Ubuntu
Dead or Alive 4
4 Problems
Plan of attack mod (Beta 4 Release Plans) (56k warning)
SimCity 4
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.