Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
form mail php skripta

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
fulspectrum



Joined: 20 Nov 2003
Posts: 296
Location: Ljubljana <>Split

PostPosted: 19.06.2006 13:55    Post subject: form mail php skripta Add user to your forum ignore list Reply with quote

Kako napraviti kad skripta pošalje mail da ignorira ona polja koja su ostala prazna.
Dakle kad primim mail sa ispunjenim formularom da dodju samo upisana polja.

Npr. jedan input tag formulara izgleda ovako:

Code:
<input name="nprojekta" type="text" size="30" value="<?=stripslashes(htmlspecialchars($nprojekta));?>" />


PHP odgovarajući kod:

Code:
   $message = "--".$boundary."\n";
      $message.="Content-Type: text/plain; charset=\"iso-8859-2\"\n";
      $message.="Content-Transfer-Encoding: quoted-printable\n";
        $message.="\n";
      $message.="Ime projekta: $nprojekta";


U slučaju da "Ime projekta" ostane prazno meni svejedno na mail dolazi:
Ime projekta:

Kako napraviti da skripta to ignorira i da mail stigne bez tog inputa?

Tnx!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
les



Joined: 25 Oct 2004
Posts: 370

PostPosted: 19.06.2006 14:21    Post subject: Add user to your forum ignore list Reply with quote

Provjeri jednostavno da li tražena varijabla postoji ili koja je njezina duljina (isset ili strlen) i prema tome formiraj varijablu $message...
Back to top
View user's profile Send private message Send e-mail
fulspectrum



Joined: 20 Nov 2003
Posts: 296
Location: Ljubljana <>Split

PostPosted: 19.06.2006 14:44    Post subject: Add user to your forum ignore list Reply with quote

les wrote:
Provjeri jednostavno da li tražena varijabla postoji ili koja je njezina duljina (isset ili strlen) i prema tome formiraj varijablu $message...


Je li mozes to napisat, ne znam tako dobro php. Hvala!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Gale



Joined: 04 Apr 2005
Posts: 120

PostPosted: 19.06.2006 16:23    Post subject: Add user to your forum ignore list Reply with quote

Code:
if(!empty(trim($nprojekta))){
      $message.="Ime projekta: $nprojekta";
}
Back to top
View user's profile Send private message Visit poster's website
fulspectrum



Joined: 20 Nov 2003
Posts: 296
Location: Ljubljana <>Split

PostPosted: 19.06.2006 17:52    Post subject: Add user to your forum ignore list Reply with quote

Gale wrote:
Code:
if(!empty(trim($nprojekta))){
      $message.="Ime projekta: $nprojekta";
}


Probala sam pa ne radi. Original skripta se inace nalazi ovdje pa ako se nekome da pogledat:
http://www.phphq.net/scripts.php?p=free-scripts&id=5
Back to top
View user's profile Send private message Send e-mail Visit poster's website
fulspectrum



Joined: 20 Nov 2003
Posts: 296
Location: Ljubljana <>Split

PostPosted: 20.06.2006 13:51    Post subject: Add user to your forum ignore list Reply with quote

Any HELP? Crying or Very sad
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 20.06.2006 16:18    Post subject: Add user to your forum ignore list Reply with quote

Traži malo više na forumu. Svaka treća tema je contactform skripta

http://www.mi3dot.org/forum/viewtopic.php?p=88930#88930
Back to top
View user's profile Send private message Send e-mail Visit poster's website
pvujic



Joined: 01 Sep 2005
Posts: 14

PostPosted: 21.06.2006 13:07    Post subject: Add user to your forum ignore list Reply with quote

Evo nabrzaka, nisam isprobao

Code:

<?php
if (@$_POST['email'] != "")
{
$email = $_POST['email'];
$title = $_POST['title'];
$content = $_POST['content'];
$headers = "From: $email" . "\r\n" .
   "Reply-To: $email" . "\r\n" .
   'X-Mailer: PHP/' . phpversion();

$mail = mail('tvoj@email', $title, $content, $headers);
if ($mail == true) {
$status = "Mail sent!";
exit();
} else {
$status = "Mail not sent. Try again later!";
exit();
}
}
?>

<html>
<body>

<form method="post" action="<?php $_SERVER['PHP_SELF'] ?>">
 Email: <input type="text" name="email">
 <br>
 Title: <input type="text" name="title">
 <br>
 Content: <input type="text" name="content">
 <br>
 <input type="submit" value="Send"> <b><?php echo $status; ?></b>
</form>

</body>
</html>
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group