Jump to content
php.lv forumi

Epasts


Mikijs

Recommended Posts

Sveiki =] atkal man ir jautajums - kas man ir nepareizi?

 

<?php
function funcParbauditPastu($sEpastaAdrese)
{
$sTeksti = "^[A-Za-z0-9\._-]+@([A-Za-z][A-Za-z0-9-]{1,62})(\.[A-Za-z][A-Za-z0-9-]{1,62})+$";

$bIrDerigs = true;
if(!ereg("$sTeksti",$sEpastaAdrese))
{
	$bIrDerigs = false;
}
return $bIrDerigs;

}


function funcSutitPastu($sanemejs,$temats,$vestule,$noka,$atbildet)
{
$array = array ("\'" => "'");	 
$vestule = strtr($vestule, $array);   
$vestule = '<html><body>'.$vestule.'</body></html>'."\r\n\r\n";
$ekstra = 'From: '.$noka.' <'.$atbildet.'>'."\r\n";
$ekstra .= 'Content-Type: text/html; charset="utf-8"'."\r\n";
$ekstra .= 'Content-Transfer-Encoding: quoted-printable'."\n\r\n";
mail ($sanemejs, $temats, $vestule, $ekstra);
echo '<hr>Vestule ir nosutita uz <'.$sanemejs.'> epastu!<hr>';
}

if((funcParbauditPastu($_GET['sanemejs'])) && (funcParbauditPastu($_GET['sutitajs'])))
{
funcSutitPastu($_GET['sanemejs'],'Re:'.$_GET['temats'],$_GET['vestule'],$_GET['novards'],$_GET['nomeils']);
}

echo "<br><form action='".$PHP_SELF."' method='post'>
<input type='text' name='sanemejs' value=''>
<input type='text' name='nomeils' value=''>
<input type='text' name='novards' value=''>
<input type='text' name='temats' value=''>

<textarea name='vestule'></textarea>
<input type='submit' value='Sutit'>
<input type='reset' value='Atcelt!'>
</form>";

?>

itka viss ir pareizi =/ bet man nesutas

Link to comment
Share on other sites

×
×
  • Create New...