Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

email on submit

the mail() function

Moderators: macek, egami, gesf

email on submit

Postby zeeba42 » Tue Sep 11, 2012 9:25 am

I need to also email out what ever was typed into the text area. I can't seem to figure it out I am really new to php.
Code: Select all

<?php

function make_content_file($filename,$content,$opentype="w"){
    $fp_file = fopen($filename, $opentype);
    fputs($fp_file, $content);
    fclose($fp_file);

}



$filename = "outage.txt";

if($_POST){
 $newcontents=$_POST[newcontents];
 make_content_file($filename,$newcontents);

}



$filecontents = file_get_contents($filename);



?>



<form method="post">

<textarea name="newcontents" cols="30" rows="3">

<?php
if($_POST)
{
echo 'Message posted!';
   
   
}
?>

</textarea>
<br>

<input type="submit" value="Update"> 
</form>

zeeba42
New php-forum User
New php-forum User
 
Posts: 1
Joined: Tue Sep 11, 2012 9:23 am

Return to PHP coding => Mail

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron