Napravio 3 text boxa:
1. Ime
2. Tvoj E-mail
3. Komentar
I dodao im redom var atribute:
1. fname
2. email
3. comments
Zatim sam u prvi frame od prvog layera dodao sledeću skriptu:
fscommand ("allowscale", "false");
//
// set some variables
//
mailform = "contact.php";
confirm = "Please wait for confirmation..."
action = "send";
//
// and focus on variable fname
//
Selection.setFocus("fname");
//
// validate email function
//
function validate (address) {
if (address.length>=7) {
if (address.indexOf("@")>0) {
if ((address.indexOf("@")+2)<address.lastIndexOf(".")) {
if (address.lastIndexOf(".")<(address.length-2)) {
return (true);
}
}
}
}
return (false);
}
//
//form check
//
function formcheck () {
if ((((email == null)) || (email.length<1)) || (email == "ERROR! Address not valid")) {
email = "ERROR! Address not valid";
action = "";
}
if (!validate(email)) {
email = "ERROR! Address not valid";
action = "";
}
if (fname == null) {
fname = "ERROR! Name required";
action = "";
}
if ((validate(email)) && (email != "ERROR!") && (fname != "")){
action = "send";
loadVariablesNum (mailform, 0, "POST");
}
}
stop ();
A na dugme (pošalji) dodao:
on (release) {
formcheck();
}
Napravio sam i jedan contact.php u kojem je:
<?
// Enter your contact email address here
$adminaddress = "mojmail@ moja_stranica.com";
// Enter the address of your website here include http://www.
$siteaddress ="http://www.moja_stranica.com";
// Enter your company name or site name here
$sitename = " moja_stranica ";
//this is a test and only a test
$sweeps = " moja_stranica.com";
/*******************************************************
No need to change anything below ...
*******************************************************/
// Gets the date and time from your server
$date = date("m/d/Y H:i:s");
// Gets the IP Address
if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);
//Process the form data!
// and send the information collected in the Flash form to Your nominated email address
if ($action != ""):
mail("$adminaddress","Info Request",
"Posjetilac na $sitename je poslao sledecu informaciju\n
Ime: $fname
Email: $email
Posjetilac je komentarisao:
------------------------------
$comments
Logged Info :
------------------------------
Using: $HTTP_USER_AGENT
Hostname: $ip
IP address: $REMOTE_ADDR
Date/Time: $date","FROM:$adminaddress");
//This sends a confirmation to your visitor
mail("$email","Hvala za posjetu $sitename",
"Hi $fname,\n
Hvala ti za kontakt $sweeps!\n
$sitename
$siteaddress","FROM:$adminaddress");
endif;
?>
Naravno gore u .php su moji pravi podaci o stranici i emailu.
E sad, neće da mi komentar stigne na moj email? Kad npr. se ukuca email bez @ javlja u email boxu:
ERROR! Address not valid
Zna li ko u čemu je kvaka mog problema?
[Ovu poruku je menjao _warp dana 31.08.2005. u 19:29 GMT+1]