Hi zusammen ich bastel grad an einem Kontaktformular wo man Dateianhänge hinzufügen kann. Mein größtes Problem ist ich kann nicht sehr gut PHP
was ich grad versuch zu ändern.
Also ich hab schon in Flash was zusammen gebaut:
das ist meine .swf datei zum anschaun.
http://mahdi.alfahosting.org/privats...ilformular.swf
Und das hier ist das Action Script was ich im Flash geschrieben hab :
Zitat:
function uploadImage(event)
{
imageFile.browse([{description: "Files", extension: "*.jpg;*.gif;*.png;*.xls;*.doc;*.txt;*.html;*.php; *.fla;*.swf;*.mp3;*.psd;*.pdf;*.wav;*.aif;*.rar;*. zip;"}]);
} // End of the function
function imageDownloaded(event)
{
if (event.total == -1)
{
imagePane.contentPath = "error";
} // end if
} // End of the function
function downloadImage(file)
{
imagePane.contentPath = "./files/" + file;
} // End of the function
function uploadImage(event)
{
imageFile.browse([{description: "Files", extension: "*.jpg;*.gif;*.png;*.xls;*.doc;*.txt;*.html;*.php; *.fla;*.swf;*.mp3;*.psd;*.pdf;*.wav;*.aif;*.rar;*. zip"}]);
} // End of the function
function imageDownloaded(event)
{
if (event.total == -1)
{
imagePane.contentPath = "error";
}
else
{
statusArea.text = "Die Übertragung war erfolgreich, Bitte drücken sie den Sende button.";
} // end else if
} // End of the function
function downloadImage(file)
{
imagePane.contentPath = "./files/" + file;
} // End of the function
stop ();
System.security.allowDomain("http://localhost/");
var listener = new Object();
listener.onSelect = function (selectedFile)
{
statusArea.text = details.text = "";
statusArea.text = statusArea.text + ("" + selectedFile.name + "\n");
selectedFile.upload("upload.php");
};
listener.onOpen = function (selectedFile)
{
statusArea.text = statusArea.text + ("Uploading " + selectedFile.name + "\n");
};
listener.onHTTPError = function (file, httpError)
{
imagePane.contentPath = "error";
imagePane.content.errorMSG.text = "HTTPError number: " + httpError + "\nFile: " + file.name;
};
listener.onIOError = function (file)
{
imagePane.contentPath = "error";
imagePane.content.errorMSG.text = "IOError: " + file.name;
};
listener.onSecurityError = function (file, errorString)
{
imagePane.contentPath = "error";
imagePane.content.errorMSG.text = "SecurityError: " + SecurityError + "\nFile: " + file.name;
};
listener.onComplete = function (selectedFile)
{
statusArea.text = statusArea.text + ("Upload finished.\nNow downloading " + selectedFile.name + " to player\n");
_root.emailform.uploadfile = "" + selectedFile.name + "";
details.text = "";
for (i in selectedFile)
{
details.text = details.text + ("<b>" + i + ":</b> " + selectedFile[i] + "\n");
} // end of for...in
downloadImage(selectedFile.name);
};
var imageFile = new flash.net.FileReference();
imageFile.addListener(listener);
uploadBtn.onPress = uploadImage;
imagePane.addEventListener("complete", imageDownloaded);
stop ();
listener.onHTTPError = function (file, httpError)
{
imagePane.contentPath = "error";
imagePane.content.errorMSG.text = "HTTPError number: " + httpError + "\nFile: " + file.name;
};
listener.onIOError = function (file)
{
imagePane.contentPath = "error";
imagePane.content.errorMSG.text = "IOError: " + file.name;
};
listener.onSecurityError = function (file, errorString)
{
imagePane.contentPath = "error";
imagePane.content.errorMSG.text = "SecurityError: " + SecurityError + "\nFile: " + file.name;
};
listener.onComplete = function (selectedFile)
{
statusArea.text = statusArea.text + ("Upload finished.\nNow downloading " + selectedFile.name + " to player\n");
_root.uploadfile = "" + selectedFile.name + "";
details.text = "";
for (i in selectedFile)
{
details.text = details.text + ("<b>" + i + ":</b> " + selectedFile[i] + "\n");
} // end of for...in
downloadImage(selectedFile.name);
};
var imageFile = new flash.net.FileReference();
imageFile.addListener(listener);
uploadBtn.onPress = uploadImage;
imagePane.addEventListener("complete", imageDownloaded);
stop ();
one.drawFocus = "";
two.drawFocus = "";
three.drawFocus = "";
four.drawFocus = "";
imagePane.drawFocus = "";
uploadBtn._focusrect = false;
clearBtn._focusrect = false;
sendBtn._focusrect = false;
|
Was genau muss ich im Upload.php rein schreiben damit es funktioniert und man es absenden kann?
Danke das ihr mir dabei hilft. euer PP