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
- <div id="desktop" class="desktop" align="left">
- <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;">
- <table>
- <tr>
- <td>
- Upload Background:<br />
- </td>
- <td rowspan="3"><div id="showimg"></div>
- </td>
- </tr>
- <tr>
- <td>
- <input type="file" id="myfile" name="myfile" />
- </td>
- </tr>
- <tr>
- <td>
- <input type="submit" value="Upload" />
- </form>
- </td>
- </tr>
- <tr>
- <td>
- <iframe id="uploadframe" name="uploadframe" src="processUpload.php"></iframe>
- </td>
- </tr>
- </table>
- </div>
Expand|Select|Wrap|Line Numbers
- function uploadDesktop(theform) {
- theform.submit();
- }
Expand|Select|Wrap|Line Numbers
- <?php
- $allowedtypes = array("image/jpeg","image/pjpeg","image/png","image/gif");
- $savefolder = "backgrounds";
- if(isset($_FILES['myfile'])){
- if(in_array($_FILES['myfile']['type'],$allowedtypes)) {
- if($_FILES['myfile']['error'] == 0) {
- $back = $savefolder . "/" . $_FILES['myfile']['name'];
- if(!move_uploaded_file($_FILES['myfile']['tmp_name'],$back)) {
- echo"There was and error";
- } else {
- //signal
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <script type="text/javascript">
- function doneloading(theframe,thefile){
- var theloc = "showimg.php?thefile=" + thefile
- theframe.processajax("showimg",theloc);
- }
- </script>
- </head>
- <body onLoad="doneloading(parent,'<?=$thefile?>')">
- <img src="<?=$thefile?>" />
- </body>
- </html>
- <?php
- }
- }
- }
- }
- ?>
Thanks,
EpicOfChaos