1
kaotik
Javascript and php, passing variables
  • 2004/10/15 3:09

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


Hi, I have a some code that uploads a file through a form in a popup window. The uploading part works. Now what I want is to show the name of the file uploaded in the original window.

Here's the javascript from the original window
echo "<script language="javascript">n"
    
."function open_w(file) {n"
    
."    newwin = window.open(file,'Attachments','width=300, height=200, left=200, top=150, scrollbars=no, toolbar=no');n"
    
."}n"
    
."n"
    
."function attachfiles(files,types) {n"
    
."    window.document.all.Atts.innerText = files;n"
    
."    document.emailform.attachment.value = files;n"
    
."    document.emailform.attchtype.value = types;n"
    
."n"
    
."</script>n";


And here's the form from the popup window:
echo "<form name="emailform" id="upload" ENCTYPE="multipart/form-data" method="post"><p>"
    
."<input type="file" id="userfile" name="userfile">"
    
."<input type="submit" name="upload" value="Upload"></p>"
    
."<p><input type="submit" name="submit" onClick="window.close()" value="Close"></p></form>";


Please help!

Login

Who's Online

218 user(s) are online (146 user(s) are browsing Support Forums)


Members: 0


Guests: 218


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits