Code:
function getxmlhttp(){
var xmlhttp=false;
try {
xmlhttp= new ActiveXObject("Msxml2.XMLHTTP");
} catch(e){
try{
xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
xmlhttp= false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined'){
xmlhttp= new XMLHttpRequest();
}
return xmlhttp;
};
function processajax(obj,serverPage){
var lok="Slanje je u tijeku!";
var xmlhttp=getxmlhttp();
xmlhttp.open("POST",serverPage+"&ssid="+Math.random(),true);
*document.getElementById(obj).innerHTML=lok;
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && (xmlhttp.status==200 || xmlhttp.status == 304)){
document.getElementById(obj).innerHTML=xmlhttp.responseText;
}
}
xmlhttp.send(null);
};
function posalji(form_id,ime,email,poruka){
var ko=document.forms[form_id].elements[ime].value;
var email=document.forms[form_id].elements[email].value;
var poruka=document.forms[form_id].elements[poruka].value;
if ((verificirajEmail('emailForma','email')==true) && (prazno('emailForma','ime')==true) && (prazno('emailForma','poruka')==true))
{
var lokacija= "posalji.php?ko="+ko+"&email="+email+"&poruka="+poruka;
processajax("tijeloMail",lokacija);
};
};
function getxmlhttp(){
var xmlhttp=false;
try {
xmlhttp= new ActiveXObject("Msxml2.XMLHTTP");
} catch(e){
try{
xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
xmlhttp= false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined'){
xmlhttp= new XMLHttpRequest();
}
return xmlhttp;
};
function processajax(obj,serverPage){
var lok="Slanje je u tijeku!";
var xmlhttp=getxmlhttp();
xmlhttp.open("POST",serverPage+"&ssid="+Math.random(),true);
*document.getElementById(obj).innerHTML=lok;
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && (xmlhttp.status==200 || xmlhttp.status == 304)){
document.getElementById(obj).innerHTML=xmlhttp.responseText;
}
}
xmlhttp.send(null);
};
function posalji(form_id,ime,email,poruka){
var ko=document.forms[form_id].elements[ime].value;
var email=document.forms[form_id].elements[email].value;
var poruka=document.forms[form_id].elements[poruka].value;
if ((verificirajEmail('emailForma','email')==true) && (prazno('emailForma','ime')==true) && (prazno('emailForma','poruka')==true))
{
var lokacija= "posalji.php?ko="+ko+"&email="+email+"&poruka="+poruka;
processajax("tijeloMail",lokacija);
};
};
posalji.php
Code:
<?
$ko=$_GET['ko'];
$email=$_GET['email'];
$poruka=$_GET['poruka'];
if(!empty($email) && !empty($poruka)) {
$mailContent = "Poruka: $poruka\n";
$toAddress = "[email protected]";
mail($toAddress,$subjekt,$mailContent,"From: $email");
/*
echo "<div class='poslanMail'>Vaš e-mail je poslan! \n</div>";
*/
Echo "Ok!";
} else {
Echo "Nije Ok!";
/* echo "<div class='poslanMailGreska'>Neka polja su prazna.\n</div>";*/
}
?>
<?
$ko=$_GET['ko'];
$email=$_GET['email'];
$poruka=$_GET['poruka'];
if(!empty($email) && !empty($poruka)) {
$mailContent = "Poruka: $poruka\n";
$toAddress = "[email protected]";
mail($toAddress,$subjekt,$mailContent,"From: $email");
/*
echo "<div class='poslanMail'>Vaš e-mail je poslan! \n</div>";
*/
Echo "Ok!";
} else {
Echo "Nije Ok!";
/* echo "<div class='poslanMailGreska'>Neka polja su prazna.\n</div>";*/
}
?>
molim Vas da mi pomognete da otkrijem gresku u IE (unknown error on line *)... u FF je sve ok
Give me six hours to chop down a tree and I will spend the first four sharpening the axe.