Werte Forumleser,
ich habe folgendes Problem,
ich möchte per http_request ein Formula absenden NUR leider kommt bei meiner sendmail.php keine Variabel an - was mache ich falsch??
<DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script type="text/javascript">
function makeRequest() {
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType("text/json");
}
} else {
if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
}
}
}
}
if (!http_request) {
alert("End :( Can not create XMLHTTP-instance!");
return false;
}
aRequest = "sendmail.php"
http_request.onreadystatechange = alertContent;
http_request.open("POST", aRequest, true); ///// hier soll der formularhinhalt gesetzt werden
http_request.setRequestHeader("Pragma", "no-cache");
http_request.setRequestHeader("Cache-Control", "must-revalidate");
http_request.setRequestHeader("If-Modified-Since", document.lastModified);
http_request.send(null);
}
function alertContent() {
if (http_request.readyState == 4) {
alert(http_request.responseText); //testausgabe !!!!!!!!
}
}
</script>
</head>
<body>
Sende einen Text per Formula ...
<form action="javascript:makeRequest()" method="POST">
eMail: <input type="text" name="email"><br/>
Betreff: <input type="text" name="betreff"><br/>
Message: <textarea name="message"></textarea><br/>
<input type="submit" value="abschicken">
</form>
</body>
</html>
Geht was so überhaupt - gib es andere ajax techniken für diesen Fall.
Bin um jeden Tip dankbar
oldTom