Jump to content

php Script just does not work...


Bobski2000

Recommended Posts

Hi guys,

I'm really new to this and would love a little bit of help if possible.

Me and a few others have a website where i've made this form, in Dreamweaver, so that others can join. The problem is i've looked for a script to make the form work and upto now i just cannot get it to work. Once i've clicked on the send now button i run the script (Which is at the bottom) No email comes to me. Have a done something wrong?

 

Our signup page is www.fubarlegion.org/signup so you can check out our signup page.

The Script:-

 

<?php



/* Subject and email varibles */



$emailSubject = 'Fubar Application';

$webMaster = '[email protected]';



/* Gathering data Variables */



$usernameField = $_POST['username'];

$nameField = $_POST['name'];

$emailField = $_POST['email'];

$findingusField = $_POST['findingus'];

$rssfieldField = $_POST['rssfield'];

$commentsField = $_POST['comments'];



$body = <<<EOD

<br><hr><br>

Username: $username <br>

Name: $name <br>

Email: $email <br>

How Did You Finding Us: $findingus <br>

Rss Yes Or No: $rssfield <br>

Comments: $comments <br>

EOD;



$headers = "From: $emailFeild\r\n";

$headers .= "Content-type: text/html\r\n";

$success = mail($webmaster, $emailSubject, $body, $headers);



/* Results Rendered as html */



$theResults = <<<EOD



<html>

<head>

<title>F.U.B.A.R Sign up Page</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">

<!--

body {

background-color: #f1f1f1;

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 12px;

font-style: normal;

line-height: normal;

font-weight: normal;

color: #666666;

text-decoration: none;

}

-->

</style>

</head>



<div>

  <div align="left">Thank you for your interest! Your email will be answered very soon!</div>

</div>

</body>

</html>

EOD;

echo "$theResults";



?>

Link to comment
https://forums.phpfreaks.com/topic/146357-php-script-just-does-not-work/
Share on other sites

$emailField << post email to the user i guess is wrong

and not right on your email code change it.

 

is this what you ment dont no you tell me.

<?php
$success = mail($emailField , $emailSubject, $body, $headers);
?>

 

this should be added as a FROM: header field i am guessing.

  $webMaster = '[email protected]';

Whilst reading the script again i noticed a School Boy ErroR.

In the    $body = <<<EOD

 

All the $ are wrong. :(

Instead of $username it should be $usernameField  ;D

 

My god I need those stupid pills again.

Thanks guys for the help. I would have been knocking myself out over this..

Cheers Again.

Dave :)

kindly tell us did this way off formatting your code with heredoc

work with the email function.

<?php

$body = <<<EOD

<br><hr><br>

Username: $username <br>

Name: $name <br>

Email: $email <br>

How Did You Finding Us: $findingus <br>

Rss Yes Or No: $rssfield <br>

Comments: $comments <br>

EOD;

?>

 

 

 

Like i said i completely wrote the $ wrong. they all needed the full string names.

 

$username should have been $usernameField etc...

 

heredoc? is that a form of php stuff?

 

I got the original script from  tutvid.com but even he did it wrong, and with your help guys i've sorted it.

Ta

Dave :)

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.