PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 22nd, 2005, 10:32 AM
confirm045 confirm045 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 26 confirm045 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 1 m 54 sec
Reputation Power: 0
$file problem...

ive got a $file and its suppose to contain the file that i want. It works fine on my PC as im using phptriad. But when i tried it on a server, it didnt work. Do i need to specify what $file is? How do i do that?
Thanx

Reply With Quote
  #2  
Old February 23rd, 2005, 08:06 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,886 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 19 m 35 sec
Reputation Power: 18
um, what is $file?

[maybe you could post a little snippet of your code]

Reply With Quote
  #3  
Old February 23rd, 2005, 09:13 AM
confirm045 confirm045 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 26 confirm045 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 1 m 54 sec
Reputation Power: 0
if($File)

{

// create a table with invisible border
print "<table width=\"450\" border=\"0\">";

print "<tr>";

// prints out the name of the uploaded file
print "<td width=\"410\">File Name: <strong> $File_name </strong> <p>\n </td>";

print "</tr>";

print "<tr>";

// prints the size of the file in bytes
print "<td> <br>File size: <strong> $File_size bytes </strong> <p>\n </td>";

print "</tr>";

print "</table>";

print "<br>";


$strSQL = "INSERT INTO file (file_id, file_name, file_size, upload_date) VALUES ('', '$File_name', '$File_size', NOW())";

$result = mysql_query($strSQL);


// copies the file information and stores it to the database
if (copy($File, $result))
{
print " File successfully uploaded! <p> \n";
}
else
{
print " Unable to upload file <p> \n";
}

// deletes the file if upload unsuccessful
unlink ($File);

}

Reply With Quote
  #4  
Old February 24th, 2005, 07:56 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,886 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 19 m 35 sec
Reputation Power: 18
Sounds like Register Globals is turned off on the server.

You could try referring to PHP Builder for an implicit solution.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > $file problem...


Developer Shed Advertisers and Affiliates


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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap