php file upload functions

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
mythix
-


Joined: 13 Jun 2002
Posts: 20
Location: UK - Frome

PostPosted: Mon May 26, 2003 10:55 pm    Post subject: php file upload functions Reply with quote

Hi,

I am writing a PHP script to upload images and am testing it locally on my machine with Abyss.

The following is currently at the top of the script, so I could see if the file was uploading properly. The thing is, it NEVER prints 'moo'!!!

Code:
if ($uploadedfile) {
   echo "moo";
   }


Here is the form

Code:
<form action="uploadimage.php" method="post" enctype="multipart/form-data">
  <table width="100%" border="0" cellpadding="2" cellspacing="0" class="txt">
    <tr valign="top">
      <td>File:</td>
      <td><input name="uploadedfile" type="file" class="txtform"></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input name="textid" type="hidden" id="textid" value="<?=$HTTP_GET_VARS[textid]?>">
        <input name="submit" type="submit" class="txtform" id="submit" value="Submit"></td>
    </tr>
  </table>
</form>


is there somthing wrong with my code, or does Abyss not support this, or os there a CGI environment variable I need to set for this to work???

Thanks
Back to top View user's profile Send private message Send e-mail Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Wed May 28, 2003 1:08 am    Post subject: Re: php file upload functions Reply with quote

mythix wrote:
Hi,

I am writing a PHP script to upload images and am testing it locally on my machine with Abyss.

The following is currently at the top of the script, so I could see if the file was uploading properly. The thing is, it NEVER prints 'moo'!!!

Code:
if ($uploadedfile) {
   echo "moo";
   }


Here is the form

Code:
<form action="uploadimage.php" method="post" enctype="multipart/form-data">
  <table width="100%" border="0" cellpadding="2" cellspacing="0" class="txt">
    <tr valign="top">
      <td>File:</td>
      <td><input name="uploadedfile" type="file" class="txtform"></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input name="textid" type="hidden" id="textid" value="<?=$HTTP_GET_VARS[textid]?>">
        <input name="submit" type="submit" class="txtform" id="submit" value="Submit"></td>
    </tr>
  </table>
</form>


is there somthing wrong with my code, or does Abyss not support this, or os there a CGI environment variable I need to set for this to work???

Thanks

This is a PHP coding problem. Use $_REQUEST['uploadedfile'] instead of just $uploadedfile.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
mythix
-


Joined: 13 Jun 2002
Posts: 20
Location: UK - Frome

PostPosted: Wed May 28, 2003 8:12 pm    Post subject: Reply with quote

Thanks!!!
Back to top View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group