Ako misliš na ovaj drugi link onda je dovoljno samo u ovom prvom kodu (koji pravi formu) promjeniš to što želiš.
Dakle,
Code:
<form action="mailer.php" method="post" name="form1" id="form1" style="margin:0px; font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px; width:300px;" onsubmit="MM_validateForm('from','','RisEmail','subject','','R','verif_box','','R','message','','R');return document.MM_returnValue">
Vase Ime:<br />
<input name="ime" type="text" id="from" style="padding:2px; border:1px solid #CCCCCC; width:180px; height:14px; font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;" value="<?php echo $_GET['ime'];?>"/>
<br />
<br />
Vase e-mail: <br />
<input name="mail" type="text" id="subject" style="padding:2px; border:1px solid #CCCCCC; width:180px; height:14px;font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;" value="<?php echo $_GET['mail'];?>"/>
<br />
<br />
Otkucajte verifikacionu sliku:<br />
<input name="verif_box" type="text" id="verif_box" style="padding:2px; border:1px solid #CCCCCC; width:180px; height:14px;font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;"/>
<img src="verificationimage.php?<?php echo rand(0,9999);?>" alt="verification image, type it in the box" width="50" height="24" align="absbottom" /><br />
<br />
<!-- if the variable "wrong_code" is sent from previous page then display the error field -->
<?php if(isset($_GET['wrong_code'])){?>
<div style="border:1px solid #990000; background-color:#D70000; color:#FFFFFF; padding:4px; padding-left:6px;width:295px;">Wrong verification code</div><br />
<?php ;}?>
Poruka:<br />
<textarea name="message" cols="6" rows="5" id="message" style="padding:2px; border:1px solid #CCCCCC; width:300px; height:100px; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;"><?php echo $_GET['message'];?></textarea>
<input name="Submit" type="submit" style="margin-top:10px; display:block; border:1px solid #000000; width:100px; height:20px;font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; padding-left:2px; padding-right:2px; padding-top:0px; padding-bottom:2px; line-height:14px; background-color:#EFEFEF;" value="Send Message"/>
</form>
A zatim u posljednjem fajlu samo ispraviš ono što si gore izmjenjala. Srednji fajl ne diraj.
Code:<?php
// remember to replace
[email protected] with your own email address lower in this code.
// load the variables form address bar
$mail = $_REQUEST["mail"];
$message = $_REQUEST["message"];
$ime = $_REQUEST["ime"];
$verif_box = $_REQUEST["verif_box"];
// remove the backslashes that normally appears when entering " or '
$message = stripslashes($message);
$mail = stripslashes($mail);
$ime = stripslashes($ime);
// check to see if verificaton code was correct
if(md5($verif_box).'a4xn' == $_COOKIE['tntcon']){
// if verification code was correct send the message and show this page
mail("
[email protected]", 'Online Form: '.$mail, $_SERVER['REMOTE_ADDR']."\n\n".$message, "From: $ime");
// delete the cookie so it cannot sent again by refreshing this page
setcookie('tntcon','');
} else {
// if verification code was incorrect then return to contact page and show error
header("Location:".$_SERVER['HTTP_REFERER']."?subject=$mail&from=$from&message=$message&wrong_code=true");
exit;
}
?>
Ovo je bilo na brzinu, nadam se da nisam nešto propustio.
Beneath civilization's fragile crust, cold chaos churns...