SunQuest
           PHP Installation
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Installation

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old July 28th, 2005, 01:12 AM
darkane darkane is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 1 darkane User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Wierdness in PHP

Hi All,

I hope someone can help me.

I have a laptop running windows XP pro SP2 with apache 2, mysql and php 4.3.11
and a server running OpenBSD 3.6 php 4.3.8 and mysql.

The problem I have is with uploading.

The script works fine on my laptop but not on the server.

I have check everything that the php manual specifies for the php.ini file and also compared both that and the httpd.conf files against my laptop and server and changed any differing configuration values to = my laptop.

This still hasnt fixed the issue and i get the exact same result when trying to upload.

From what I can see when I turned all my errors and notices on the userfile (being the input type=file) doesnt seem to be passed to the php handling the upload but everything else in the form is passed.

I receive the notice, Undefined Index: userfile when attempting.

Does anyone have any suggestions or ideas on this. Could it be a bug in the php version???

I am at a lost, I hope someone can help.

Thanks to all in advance that suggest or have any ideas on this troubling subject.

relevent code is below..

php Code:
Original - php Code
  1.  
  2. <?php
  3. // In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
  4. // of $_FILES.
  5. if(isset($_POST['submit']) || count($_FILES) > 0)
  6. {
  7.     $uploaddir = './';
  8.  
  9.     $uploadfile = $uploaddir . $_FILES['userfile']['name'];
  10.  
  11.     echo '<pre>';
  12.     if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile))
  13.     {
  14.         echo "File is valid, and was successfully uploaded.n";
  15.     }
  16.     else
  17.     {
  18.         echo "Possible file upload attack!n";
  19.     }
  20.  
  21.     echo 'Here is some more debugging info:';
  22.     print_r($_FILES);
  23.     print "</pre>";
  24. }
  25. ?>
  26.  
  27. <HTML>
  28. <form enctype="multipart/form-data" method="POST" action ="<?php echo $_SERVER['PHP_SELF']; ?>">
  29.     <!-- MAX_FILE_SIZE must precede the file input field -->
  30.     <input type="hidden" name="MAX_FILE_SIZE" value="300000000" />
  31.     <!-- Name of input element determines name in $_FILES array -->
  32.     Send this file: <input name="userfile" type="file" />
  33.     <input type="submit" name="submit" value="Send File" />
  34. </form>
  35. </HTML>

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Installation > Wierdness in PHP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

IBM developerWorks




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway