Jump to content

Very simple coding problem


Porkie

Recommended Posts

Hi, you forgot to close off your IF statement in mail.php

 

Change the code to:

 

 

<?php

if(isset($_POST['submit'])) {

$to = $_POST['emailfield'];


$namefield = $_POST['namefield'];
$message = "Test";

$subject = "Amity Mailing List : Thanks $namefield for registering your interest into our band";



$body = "$message";


  
mail($to, $subject, $body);
}


?>

mail.php - you missed the } to close the if statment

 

<?php
   if(isset($_POST['submit']))
   {
      $to = $_POST['emailfield'];
      $namefield = $_POST['namefield'];
      $message = "Test";
      $subject = "Amity Mailing List : Thanks $namefield for registering your interest into our band";
      $body = "$message";
      mail($to, $subject, $body);
   }
?>

cheers for the quick replies guys , most appreciated.

 

However once users have submitted they just get a white screen. I have created a page which once registation has been sucessful they will be sent to. What code would i insert to send them to that page. The page is called "Sucess.php". and i need to use the $namefile and $emailfield on the sucess.php page. how could this be possible ?

 

Cheers

going back to the contact.php and mail.php , i still arent recieving an email, it goes through but i dont recieve anything in my inbox why is this?

 

also thanks keith for your code it works however how do i get it to load the $emailvariable in a sentence ?

 

Example

 

"Thanks For Registeration $namefield"

 

How can i get that to work ?

 

Cheers

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.