473,397 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Form processing

Hey guys I am having a bit of trouble, I am trying to process a form(to upload a image) to a hidden iframe. and I am getting a error. The error is :
Method Not Allowed
The requested method POST is not allowed for the URL /Cal/code/calander.html.

Apache/1.3.33 Server at localhost Port 80

form code:
Expand|Select|Wrap|Line Numbers
  1. <div id="desktop" class="desktop" align="left">
  2.                     <form name="desk" method="post" enctype="multipart/form-data" target="uploadframe" onsubmit="uploadDesktop(this); return false" style="padding:0px 0px 0px 0px; margin:0px 0px 0px 0px;">
  3.                     <table>
  4.                     <tr>
  5.                         <td>
  6.                         Upload Background:<br />
  7.                         </td>
  8.                         <td rowspan="3"><div id="showimg"></div>
  9.                         </td>
  10.                     </tr>
  11.                     <tr>
  12.                         <td>
  13.                         <input type="file" id="myfile" name="myfile" />
  14.                         </td>
  15.                     </tr>
  16.                     <tr>
  17.                         <td>
  18.                         <input type="submit" value="Upload" />
  19.                     </form>
  20.                         </td>
  21.                     </tr>
  22.                     <tr>
  23.                         <td>
  24.                         <iframe id="uploadframe" name="uploadframe" src="processUpload.php"></iframe>
  25.                         </td>
  26.                     </tr>
  27.                     </table>
  28.  
  29.  
  30.                 </div>
  31.  
The Code for the java script involved is:
Expand|Select|Wrap|Line Numbers
  1.     function uploadDesktop(theform) {
  2.         theform.submit();    
  3.     }
  4.  
The upload processing php page is :
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $allowedtypes = array("image/jpeg","image/pjpeg","image/png","image/gif");
  3. $savefolder = "backgrounds";
  4.  
  5. if(isset($_FILES['myfile'])){
  6.     if(in_array($_FILES['myfile']['type'],$allowedtypes)) {
  7.         if($_FILES['myfile']['error'] == 0) {
  8.             $back = $savefolder . "/" . $_FILES['myfile']['name'];
  9.                 if(!move_uploaded_file($_FILES['myfile']['tmp_name'],$back)) {
  10.                     echo"There was and error";
  11.                 } else {
  12.                     //signal
  13.                     ?>
  14.                     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  15.                     <html xmlns="http://www.w3.org/1999/xhtml">
  16.                     <head>
  17.                     <script type="text/javascript">
  18.                         function doneloading(theframe,thefile){
  19.                         var theloc = "showimg.php?thefile=" + thefile
  20.                         theframe.processajax("showimg",theloc);
  21.                         }
  22.                     </script>
  23.                     </head>
  24.                     <body onLoad="doneloading(parent,'<?=$thefile?>')">
  25.                         <img src="<?=$thefile?>" />
  26.                     </body>
  27.                     </html>
  28.                     <?php
  29.                 }
  30.             }
  31.         }
  32.     }
  33. ?>
  34.  
Any help will be GREATLY appreciated.
Thanks,
EpicOfChaos
Jun 22 '07 #1
1 1398
I figured it out, sorry,
I was missing the action="" on my form LOL
Jun 22 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Danny Anderson | last post by:
Hola, PHP folk! I have a php page that contains a self-processing form. The form holds search results. The search terms originally came from the previous page, but the user can repeatedly...
8
by: dmcconkey | last post by:
Hi folks, I have a client with four websites. Each site has a contact form that is identical. They all have "required" fields validated through a JavaScript onSubmit() function. Upon validation,...
1
by: David Bradbury | last post by:
Hi On my form, as soon as the user clicks my submit button a message pops up saying "Form processing" as the form submits. This is fine as long as the user only clicks the submit button once....
8
by: Raed Sawalha | last post by:
I have form with progress bar ,when application begin processing and progress bar moving if I minimized the form and try to restore it ,it is not showing until the processing completed ,how can I...
8
by: Brian Fulford | last post by:
This is my first shot at a Winforms application in dot net. This application is mainly going to run unattended but is using a form to display current activity of the background processing. In VB6,...
12
by: Ger | last post by:
My dialogue form (sometimes partly, sometimes as a whole) remains visible during a fairly long processing job. The dialogue asks the user to enter some data for the job to follow, and after OK,...
15
by: Jack | last post by:
Hi, I have a asp form where one element is a list box which lists four years starting from 2004. This list is drawn from a database table which has YearID and Year as two fields as shown below:...
2
by: AJang | last post by:
My windows form "Form1" has one Button "button1" and one TextBox "textBox1". When I click button1, it do a job for each file in a directory. The job include some platform invoke call. Before...
2
by: rdemyan via AccessMonster.com | last post by:
My application has a lot of complicated SQL statements, calculations, processing that takes time. I've created a custom form to act like a messagebox. It has 10 small rectangles on it that change...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.