[ doboy @ 27.09.2005. 13:37 ] @
ovako... kreiram stranicu na kojoj posetioci imaju mogucnost da ostave svoje podatke i posalju mi mail, medjutim... Sve radi kako treba jedino posta ne stize. Ovako izgleda HTML kod stranice: <html> <head> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page 10</title> </head> <body> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>aleksa87</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <form method="post" action="send.php"> Name:<br> <input name="name" type="text" size="30"><br><br> Email:<br><input name="email" type="text" size="30"><br><br> Comments:<br> <input name="subject" type="text" size="30"><br><br> Message:<br> <textarea name="msg" cols="25" rows="6"></textarea><br><br> <input type="reset" value="Reset"> <input type="submit" value="Send"> </form> </body> </html></body> </html> pored njega je i PHP skripta: <?php $to ="[email protected]"; $name = $_POST['name']; $email = $_POST['email']; $subject = $_POST['subject']; $msg = $_POST['msg']; $sub = "form to mail"; $headers = "From: $name <$email>\n"; $headers .= "Content-Type: text/plain; charset=iso-8859-1\n"; $mes = "Subject: ".$subject."\n"; $mes .= "Message: ".$msg."\n"; $mes .= "Name: ".$name."\n"; $mes .= "Email: ".$email."\n"; $mes .= "Date & Time: ".$d.""; if(empty($name) || empty($email) || empty($subject) || empty($msg)) { echo "<h3>Sorry all fields are required.</h3>"; } elseif(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) { echo "<h3>Sorry the email address you entered is invalid.</h3>"; } else { mail($to, $sub, $mes, $headers); echo "<h3><center>Hvala ti $name.<br>I will get back to you as soon as posiable</center></h3>"; } ?> Mozete li mi reci gdje grijesim? |