Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: submit send email from mysql

Parašė avice· 2011 Lie. 2 12:07:38
#3

Galbut veiks

<?php
if(isset($_POST['email'])) {
$con = mysql_connect("localhost", "mysql_user", "mysql_password");
mysql_select_db("DB", $con) or die('Klaida jungiantis');
$result = mysql_query("SELECT * FROM `email_tekstas` WHERE `id`='1' LIMIT 1") or die('Klaida uzklausoi');
$data = mysql_fetch_array($result);
mail($_POST['email'], 'TESTAS', $data['tekstas']);
}else{
echo '<form action="" method="POST">E-Mail : <input type="text" name="email"><input type="submit" value="Siusti"></form>';
}
?>

Redagavo avice· 2011 Lie. 2 12:07:08