View previous topic :: View next topic
Author
Message
pink Joined: 20 Oct 2003 Posts: 32 Location: zagreb
Posted: 27.01.2004 12:41 Post subject: script needed
jel ima neko scriptu za webmail koja sadržava
ime
prezime
adresa
tel
email
poruka
thx!!!
Back to top
Hiper Joined: 14 Nov 2003 Posts: 34
Posted: 27.01.2004 12:57 Post subject:
dali mozda trebash sendmail ili formmail? to je skripta koja vuche sve inpute iz forme pa ih parsira i salje mail...
ono gugl pa zaguglaj sendmail ili formmail .....probaj i na www.hotscripts.com
i nisi rekao za koji jezik php asp ? ....
ove dvije gornje znam da ih ima u php-u a mislim da bi ih trebalo biti i u drugim jezicima ....
_________________ **************************************
Knowledge is a key to success
but inteligence boost it up
**************************************
www.ostrc.hr/hiper
Back to top
nel`chee Joined: 08 Jul 2004 Posts: 2087 Location: Rijeka
Back to top
vedran Joined: 08 Sep 2003 Posts: 458
Posted: 26.06.2005 11:52 Post subject:
nel`chee wrote: ako ti treba PHP formmail imam svoj, lako ubacim polja koja trebas..
aj pastaj source ako imas pri ruci..
Back to top
mile Joined: 10 Sep 2003 Posts: 1327 Location: Jeruzalem
Posted: 26.06.2005 12:56 Post subject:
ja koristim:
Code:
<?php
if($sentemail == "2"){
include("neuspjelo.htm");
}else{
$num = $sentmessage + 1;
setcookie("sentemail","$num",time()+600);
$email = "Poruka od:\t$ime\nE-Mail:\t$posemail\nPoruka:\t$poruka\nIP:\t$REMOTE_ADDR\n\n";
$to = "vasa.email@adresa.hr";
$subject = "Poruka sa web stranice";
$mailheaders = "From: $posemail <> \n";
$mailheaders .= "Reply-To: $posemail\n\n";
mail($to, $subject, $email, $mailheaders);
include("uspjelo.htm");
}
?>
Kod staviš u mail.php, a u html form polja s 'name' i 'id' ime, posemail, poruka i sve što dodaš naknadno..
Back to top
nel`chee Joined: 08 Jul 2004 Posts: 2087 Location: Rijeka
Posted: 26.06.2005 13:33 Post subject:
malo je poduzi... ima sve, provjeru jel izgleda ko e-mail adresa, obavezna polja, feedback u slucaju uspjeha i neuspjeha...
Code: <?php
function showcontactform($name="", $email="", $website="http://", $subject="", $message="") {
if(!$_SERVER['REMOTE_HOST']) {
$host = gethostbyaddr($_SERVER['REMOTE_ADDR']);
} else {
$host = $_SERVER['REMOTE_HOST'];
}
echo '<form action="' . $PHP_SELF . '" method="post" enctype="multipart/form-data">
<div>
<label>
<span class="formtitle">name</span>
<input name="name" class="textfield" type="text" value="' . $name . '" size="50" maxlength="50" />
</label>
</div>
<div>
<label>
<span class="formtitle">e-mail</span>
<input name="email" class="textfield" type="text" value="' . $email . '" size="50" maxlength="50" />
</label>
</div>
<div>
<label>
<span class="formtitle">website</span>
<input name="website" class="textfield" type="text" value="' . $website . '" size="50" maxlength="50" />
</label>
</div>
<div>
<label>
<span class="formtitle">subject</span>
<input name="subject" class="textfield" type="text" value="' . $subject . '" size="50" maxlength="50" />
</label>
</div>
<div>
<label>
<span class="formtitle">message</span>
<textarea name="message" cols="50" rows="5" id="message">' . $message . '</textarea>
</label>
</div>
<div>
<label>
<span class="formtitle">action</span>
<input type="hidden" name="ip" value="' . $_SERVER['REMOTE_ADDR'] . '" />
<input type="hidden" name="isp" value="' . $host . '" />
<input type="hidden" name="browser" value="' . $_SERVER['HTTP_USER_AGENT'] . '" />
<input class="button" type="submit" name="send" value="Send message" />
</label>
</div>
</form>';
}
if ($send) {
$to = 'nelchee@inobscuro.com';
$name = stripslashes($_POST['name']);
$message = stripslashes($_POST['message']);
$subject = stripslashes($_POST['subject']);
$email = $_POST['email'];
$website = $_POST['website'];
if (!(($name) && ($message) && ($email))) {
echo '<h1>Contact</h1><p>You didn\'t fill all the required fields (name, e-mail and message).</p>';
showcontactform($name, $email, $website, $subject, $message);
} elseif (!eregi('^([._a-z0-9-]+[._a-z0-9-]*)@(([a-z0-9-]+\.)*([a-z0-9-]+)(\.[a-z]{2,3})?)$', $email)) {
echo '<h1>Contact</h1><p>You didn\'t enter a valid e-mail address.</p>';
showcontactform($name, $email, $website, $subject, $message);
} else {
$message .= "\n\n***********************************************************\n\nFrom: "
. $name . "\nwww: " . $website . "\n\nIP: "
. $_POST['ip'] . "\nISP: " . $_POST['isp'] . "\nbrowser: " . $_POST['browser'];
$subject = "<!--in obscuro--> " . $subject;
if (mail($to,$subject,$message, "From: " . $name . "<" . $_POST['email'] . "> \r\n"
. "Reply-To:" . $_POST['email'] . "\r\n"
."Content-Type: text/plain; charset=UTF-8\r\n"
."X-Mailer: PHP/" . phpversion() )) {
echo '<h1>Thank you!</h1>
<p>Your message has been sent. I will try to respond as soon as I can.</p>
<p>Return to <a href="http://inobscuro.com/">main page</a></p>';
} else {
echo '<h1>Error!</h1>
<p>The message could not be sent. Please try again.</p><p>If the problem persists, click
<a href="/contact/me/by/clicking/here/">here</a> to send e-mail through your mail agent.</p>';
}
}
} else {
?>
<h1>Contact</h1>
<?
showcontactform();
}
?>
_________________ ♥ art & design portfolio ♥ free Photoshop brushes stuff ♥ sketchblog ♥ facebook ♥
Back to top
vedran Joined: 08 Sep 2003 Posts: 458
Posted: 26.06.2005 16:07 Post subject:
Hvala obojici
Back to top
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