need a simple php code created

change to this code and execute:

Code:
 <?php
error_reporting(E_ALL);
if (isset($_POST["Submit"])) {
$string = '<?php $name = "'. $_POST["name"]. '";$title = "'. $_POST["title"]. '";$email3 = "'. $_POST["email3"]. '";$description = "'. $_POST["description"]. '";?>';
$fp = fopen("config.php", "w");fwrite($fp, $string);fclose($fp);
$emailbody=file_get_contents('newsletter.html');
$emailbody=str_replace('VARIABLE',$name,$emailbody);$emailbody=str_replace('VARIABLE2',$title,$emailbody);$emailbody=str_replace('VARIABLE3',$email3,$emailbody);$emailbody=str_replace('VARIABLE4',$description,$emailbody);
echo $_POST["email3"];
mail($_POST["email3"],'Your registration was confirmed ',$emailbody);}
?>

see if your get any email printed out and email sent to the recipient email..

Thanks for your time.
It sends the email now but it sends it like in html code
HTML:
<html>
        <head>
                <title></title>
        </head>
        <body>
                <p>
                         </p>
                <table style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255);" width="600">
                        <tbody>
                                <tr>
                                        <td style="margin: 0px;">
                                                <div style="font-family: Verdana; font-size: 10px; color: rgb(51, 51, 51); text-align: right;">
 
ok, great!

add this before the mail() statement

Code:
$header='MIME-Version: 1.0' . "\r\n";
$header.='Content-type: text/html; charset=utf-8' . "\r\n";

and change the mail statement to:

Code:
mail($_POST["email3"],'Your registration was confirmed ',$emailbody, $header);
 
Thank you very much. I can`t give you more rep but that you for your time.
 
one more quick question.
The email is still being sent as html code and what should I write in the newsletter.html were the values should be replaced.
is $email3 enough?
 
when your content is html it will send it as html, if you type plain text, it will send it as plain text..

in your newsletter.html you can't put directly php variables, but you need to put like VARIABLE1, VARIABLE2... that get replaced with the str_replace statements in the script code..
 
one more quick question.
The email is still being sent as html code and what should I write in the newsletter.html were the values should be replaced.
is $email3 enough?
made it sent html it was just a missing "."
But the values in newsletter.html are not replaced.
I gived newsletter 777 permissions but still not replacing
 
To worth millions.. Thank you for your time again. That solved it.
 
in your newsletter.html put for example VARIABLE where you want something to be displayed.

then in your script code do like

$emailbody=str_replace('VARIABLE',$_POST['PHP_VARIABLE_HERE'],$emailbody);
 
Back
Top