Mam gotowy skrypt, który ma wysyłać automatycznie wynik testu na maila, ale nie chce tego robić.
Jest sugestia, aby robić to przez formmail.pl, ale to mi nie działa - może nie umiem go skonfigurować, bo to rozbudowany skrypt (IMG:
style_emoticons/default/ohno-smiley.gif)
Może jest prostszy sposób?
Nie umiem sobie poradzić, a bardzo mi na tym zależy, jeśli ktoś mógłby pomóc, byłabym wdzięczna
var ResultForm = '<html><body><form name="Results" action="http://www.turmalin.cba.pl/cgi-bin/FormMail.pl" method="post" enctype="x-www-form-encoded">';
ResultForm += '<input type="hidden" name="recipient" value="gp@turmalin.cba.pl"></input>';
ResultForm += '<input type="hidden" name="subject" value="Zabawa"></input>';
ResultForm += '<input type="hidden" name="Exercise" value="Zabawa"></input>';
ResultForm += '<input type="hidden" name="realname" value=""></input>';
ResultForm += '<input type="hidden" name="Score" value=""></input>';
ResultForm += '<input type="hidden" name="Start_Time" value=""></input>';
ResultForm += '<input type="hidden" name="End_Time" value=""></input>';
ResultForm += '<input type="hidden" name="title" value="Thanks!"></input>';
ResultForm += '<input type="hidden" name="bgcolor" value="#c0c0c0"></input>';
ResultForm += '<input type="hidden" name="text_color" value="#008080"></input>';
ResultForm += '<input type="hidden" name="sort" value="order:realname,Exercise,Score,Start_Time,End_Time"></input>';
ResultForm += '<INPUT TYPE="SUBMIT" NAME="NAME" VALUE="Sprawdź"></input>';
ResultForm += '</form></body></html>';
function GetUserName(){
UserName = prompt('imi\u0119 i nazwisko:','');
UserName += '';
if ((UserName.substring(0,4) == 'null')||(UserName.length < 1)){
UserName = prompt('imi\u0119 i nazwisko:','');
UserName += '';
if ((UserName.substring(0,4) == 'null')||(UserName.length < 1)){
history.back();
}
}
}
function SendResults(Score){
var NewName = '' + today.getTime();
var NewWin = window.open('', NewName, 'toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,,width=400,height=300');
//If user has prevented popups, no way to proceed -- exit
if (NewWin == null){
return;
}
NewWin.document.clear();
NewWin.document.open();
NewWin.document.write(ResultForm);
NewWin.document.close();
NewWin.document.Results.Score.value = Score + '%';
NewWin.document.Results.realname.value = UserName;
NewWin
.document
.Results
.End_Time
.value
= (new Date()).toLocaleString
(); NewWin.document.Results.Start_Time.value = StartTime;
NewWin.document.Results.submit();
}