zzcoolzz Posted February 26, 2010 Report Share Posted February 26, 2010 Sveiki! Es ka iesacej daudz nerubiju es gribetu paprasit palidzibu jo esmu strupcela! Vienkarsi to google ari skatijos bet nevaru laga saprast! Kads varetu pievienot sim scriptam lai varetu vel failu sutit! Ta ir tikai viena komanda bet ez nevaru to vienk izdarit! (mee big Nooob in php but i lov It) Te bus tas kods!: <?php function show_form() { ?> <form action="" method="post"> <p align="left"><strong>Your name:</strong>*<br> <input type="text" name="name" size="40" /> </p> <p align="left"><strong>Your e-mail:</strong>*<br> <input type="text" name="email" size="40"></p> <p align="left"><strong>Your subject:</strong>*<br> <input type="text" name="title" size="40"></p> <<<<<<<<<Gribetos to funkciju te! <p align="left"><strong>Your message:</strong>*<br> <textarea rows="10" name="mess" cols="50"></textarea></p> <p align="left"><input type="submit" value="Send message" name="submit"></p> </form> *<strong>Need to be completed!</strong> <? } function complete_mail() { $_POST['title'] = substr(htmlspecialchars(trim($_POST['title'])), 0, 1000); $_POST['mess'] = substr(htmlspecialchars(trim($_POST['mess'])), 0, 1000000); $_POST['name'] = substr(htmlspecialchars(trim($_POST['name'])), 0, 30); $_POST['email'] = substr(htmlspecialchars(trim($_POST['email'])), 0, 50); if (empty($_POST['name'])) output_err(0); if(!preg_match("/[0-9a-z_]+@[0-9a-z_^\.]+\.[a-z]{2,3}/i", $_POST['email'])) output_err(1); if(empty($_POST['mess'])) output_err(2); $mess = ' ==========Message for Administration========== Sender Name:'.$_POST['name'].' Sender Mail:'.$_POST['email'].' Sender Message:'.$_POST['mess']; $to = 'mail@yourmail.com'; $from='from@yourmail.com'; mail($to, $_POST['title'], $mess, "From:".$from); echo '<br><strong>Thank you! Your message was sended!</strong>'; echo '<br><strong><meta http-equiv="REFRESH" content="0;URL=http://my url/"> <font size=2 face=verdana><b>Please wait: Loading... </strong>'; } function output_err($num) { $err[0] = 'Error! Wrong name.'; $err[1] = 'Error! Wrong e-mail.'; $err[2] = 'Error! Wrong message.'; echo '<p>'.$err[$num].'</p>'; show_form(); exit(); } if (!empty($_POST['submit'])) complete_mail(); else show_form(); ?> Paldies jau ieprieks! Tikai nevajag rakstit ej google un ta talak es tur biju un man vina nepalidzeja! Quote Link to comment Share on other sites More sharing options...
Kemito Posted February 26, 2010 Report Share Posted February 26, 2010 Ieteiktu šito kodu iemest iekš - http://paste.php.lv lai var normāli saprast kautko! ;) Quote Link to comment Share on other sites More sharing options...
zzcoolzz Posted February 26, 2010 Author Report Share Posted February 26, 2010 Ieteiktu šito kodu iemest iekš - http://paste.php.lv lai var normāli saprast kautko! ;) iesviedu Quote Link to comment Share on other sites More sharing options...
xPtv45z Posted February 26, 2010 Report Share Posted February 26, 2010 http://lv.php.net/manual/en/function.mail.php Palasi komentārus, tur ir vairāki piemēri, kā pievienot failus. Quote Link to comment Share on other sites More sharing options...
waplet Posted February 26, 2010 Report Share Posted February 26, 2010 iesviedu nu tagad parādi :D Quote Link to comment Share on other sites More sharing options...
zzcoolzz Posted February 26, 2010 Author Report Share Posted February 26, 2010 (edited) nu tagad parādi :D Code Edited February 26, 2010 by zzcoolzz Quote Link to comment Share on other sites More sharing options...
foxsk8 Posted February 26, 2010 Report Share Posted February 26, 2010 http://www.html-form-guide.com/email-form/php-email-form-attachment.html plus jāņem vēl PEAR, strādā, tiko arī notestēju. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.