Mikijs Posted January 11, 2008 Report Share Posted January 11, 2008 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 More sharing options...
Delfins Posted January 11, 2008 Report Share Posted January 11, 2008 Tavs labākais draugs ir debugers un log-faili. PHP sakonfigurēji pareizi ? Izrukāji headerus - viss tur pareizi? Link to comment Share on other sites More sharing options...
Mikijs Posted January 11, 2008 Author Report Share Posted January 11, 2008 itka man atver bez erroriem =/ bet nesuuta Link to comment Share on other sites More sharing options...
andrisp Posted January 11, 2008 Report Share Posted January 11, 2008 Pārbaudi, vai tiek cauri validācijai. Tad pārbaudi vai tiek līdz mail() funkcijas izsaukšanai. Link to comment Share on other sites More sharing options...
mounkuls Posted January 11, 2008 Report Share Posted January 11, 2008 Tāpēc, ka forma sūta ar POST, nevis GET, ko meklē funkcija! Vai nu saņem ar REQUEST vai salabo lai ar POST saņem. Link to comment Share on other sites More sharing options...
Recommended Posts