Jump to content

Archived

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

Motas

I'm new... HELP!!!

Recommended Posts

im having a hell of a time trying to send an email after completing a form im having an error on line 18 and the script is as follows (also i get no email in header) help?
<html>
<head>
<title>Registration Complete!</title>
</head>
<body>
<?php
//calling registration

$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$race = $_REQUEST['race'];
//Not used: $_REQUEST['gender'], and
// $_REQUEST['submit']

// show output
echo "<p>Congratulations! You are now registered!<br \></p>
// send email
LINE 18////$body = "Thank you have registered with The Land of The Exzyled!\nSincerely,\nTheGods";
<p>You will recieve an activation link in your email at <i>$email</i>.</p>\n";
mail($_POST['$email'],'Thank you for registering, <b>$name</b>', $body, 'From:accountcreation@exzyle.com');
?>
</body>
</html>

Share this post


Link to post
Share on other sites
the error usually points to the line before the line number stated, which is this line:

[color=brown]echo "<p>Congratulations! You are now registered!<br \></p>[/color][color=red][b]";[/b][/color]

and you are missing "; at the end.  After fixing that, you will find that you will get another error right after that, on this line:

[color=red][b]$body.="[/b][/color][color=brown]<p>You will recieve an activation link in your email at $email.</p>\n";[/color]

because there is nothing there. I assume you are going for something like ^

Share this post


Link to post
Share on other sites
now everythign worked.....kinda... now i get this
You will recieve an activation link in your email at $email.

\n"; mail($_POST['$email'],'Thank you for registering, $name', $body, 'From:accountcreation@exzyle.com'); ?>

Share this post


Link to post
Share on other sites
<html>
<head>
<title>Registration Complete!</title>
</head>
<body>
<?php
//calling registration

$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$race = $_REQUEST['race'];
//Not used: $_REQUEST['gender'], and
// $_REQUEST['submit']

// show output
echo "<p>Congratulations! You are now registered!<br \></p>";
// send email
$body.="<p>You will recieve an activation link in your email at $email.</p>\n";
<p>You will recieve an activation link in your email at <i>$email</i>.</p>\n";
mail($_POST['$email'],'Thank you for registering, <b>$name</b>', $body, 'From:accountcreation@exzyle.com');
?>
</body>
</html>

Share this post


Link to post
Share on other sites
I like your code but i need to point out some things what will work better for you.

you should let a user sign up then send them a link then the link goes to an update page to tell mysql to activate the members account then when they first log in then send them the thank you message to there email account ok.

good luck.

please note the way you got it know the email account could not exist.

Share this post


Link to post
Share on other sites
well see i dont have MySQL set up thats probably a huge problem, im just learning PHP, and am VERY new. and thank you xD  ;D

Share this post


Link to post
Share on other sites
[code]
<html>
<head>
<title>Registration Complete!</title>
</head>
<body>
<?php
//calling registration

$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$race = $_REQUEST['race'];
$body = "Thank you have registered with The Land of The Exzyled!\nSincerely,\nTheGods";

//Not used: $_REQUEST['gender'], and
// $_REQUEST['submit']

// show output
echo "<p>Congratulations! You are now registered!<br \></p>";
echo "<p>You will recieve an activation link in your email at $email.</p>\n";

// send email

mail($email,"Thank you for registering, $name", $body, 'From:accountcreation@exzyle.com');
?>
</body>
</html>
[/code]

Share this post


Link to post
Share on other sites
well looks all good to me but maybe soon your get a mysql database good luck mate.

Share this post


Link to post
Share on other sites

×

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.