Hello all,
First of all I would like you to know that I'm a complete noob with php en MySql..... heck with any kind of programming actually But I'm having a lot of fun adjusting scripts to fit my needs.
I have an extreeeemly simple question... at least for you pro's that is
I've just placed the script which can be found at the bottom of the following URL on my site. Thx to the creator for making it so simple.
http://www.zend.com/manual/function.mail.php
The html mail is being sent as soon as someone has signed up to my site via an application form. The application form sents all the data to the insert.php page. The insert.php sents all the info to my MySql database and at the same time a plain text mail is being sent to me and the html mail to the applier.
So far so good. It's all working perfectly except for the fact that I want to add a personal touch to the mail. Nothing special just "Hey <Name>," in stead of "Hey there,".
I've tried using <?php echo="$Name"?> and <?php echo $Name; ?> but that won't work. It doesn't show anything when I view the mail, just "Hey ,"
It would seem that he hast lost the value of $Name, but he does print it on the plain text mail.
Hope you can understand this babbling because I find explaining it to be not that simple.
I've added the insert page below..... hope I did it correctly.
Any help is greatly appreciated!!!!
TIA 😃
Pukemon
<?php
$Ip_Address="$REMOTE_ADDR";
$Os="$HTTP_USER_AGENT";
$Status='0';
$Date_Join=date ("Y-m-d H:i:s" ,time());
#
# check for required fields
if (($Name=='')||
($Residence=='')||
($Country=='')||
($Age=='')||
($Gender=='')||
($Os=='')||
($E_Mail=='')||
($Connection=='')||
header("Location: [url]http://blabla/join_missing_fields.htm[/url]");
exit;
}
#
# Update the database with the new member data
require("blabalbla");
$sql = new MySQL_class;
$sql->Create("bla");
$sql->Insert("insert into Member values ('$Member_Id',
'$Name',
'$Residence',
'$Country',
'$Age',
'$Gender',
'$Os',
'$Connection',
'$E_Mail',
'$Homepage',
'$Ip_Address')");
$affected_rows = $sql->a_rows;
#
# Plain text mail
mail("mymail@myprovider.com","New possible Member","Name........................: $Name
Residence........................: $Residence
Country..........................: $Country
Age..............................: $Age
Gender...........................: $Gender
Operating System.................: $Os
E-mail...........................: $E_Mail
Homepage.........................: $Homepage
Connection.......................: $Connection
IP Address.......................: $Ip_Address
","From: [email]mymail@myprovider.com[/email]\n");
#
# HTML mail
/* subject */
$subject = "Thanks for applying";
/* message */
$message = '
<html>
<head>
<style type="text/css">
body {background-color: black; font-family: haettenschweiler, arial; font-size: 22px; color: #FF9900}
table {font-family: haettenschweiler, arial; font-size: 20; color: #FF9900}
hr {color: #666633}
a {color: #FFFF00}
</style>
</head>
<body>
<center>
<table border="0" width="600" style="border-style: groove; border-color: #666633" cellpadding="1" cellspacing="5">
<tr>
<th><a href="http://www.mydomain.com"><img alt="Blablabla" src="http://www.blabalbal.com/mail.JPG" border="0"></a></th>
</tr>
<tr>
<td><br>Hey <?php echo"$Name";?>,<p>
Thanks a lot for filling in our application form.</p>
</td>
</tr>
</table>
</center>
</body>
</html>
';
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
/* additional headers */
$headers .= "From: Me <mymail@myprovider.com>\r\n";
/* and now mail it */
mail($E_Mail, $subject, $message, $headers);
#
# Everything was ok
header("Location: [url]http://blabal/join_confirmation.php?Name=[/url]$Name&E_Mail=$E_Mail");
?>