General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

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 October 4th, 2002, 06:19 PM
arnorg arnorg is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 13 arnorg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
getting some file name that doesnīt exist in dir

Hello iīm trying to rename a uploaded file to the highest number in a directory that gathers all the images...

Here it is:

PHP Code:
 $picname 1000;
while(
file_exists("userpics/$picname".".jpg")){
  
$picname+1


Ok, i want the files start at 1000 and it checks wheither itīs a file is 1000.jpg if it is a file that is 1000 i inchrement it by one so the uploaded pics get 1001.jpg

But i canīt finish this function and i donīt know how to rename the file, and when i got a number that isnīt in the directory i have a another function
move_uploaded_file($file, $picname);

so the new file should be uploaded to the directory to 1001.jpg ..

Reply With Quote
  #2  
Old October 4th, 2002, 06:20 PM
arnorg arnorg is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 13 arnorg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i mean


Hello iīm trying to rename a uploaded file to the highest number in a directory that gathers all the images...

Here it is:

PHP Code:
 $picname 1000;
while(
file_exists("userpics/$picname".".jpg")){
  
$picname+1


Ok, i want the files start at 1000 and it checks wheither itīs a file is 1000.jpg if it is a file that is 1000 i inchrement it by one so the uploaded pics get 1001.jpg

But i canīt finish this function and i donīt know how to rename the file, and when i got a number that isnīt in the directory i have a another function
PHP Code:
 move_uploaded_file($file$picname); 

so the new file should be uploaded to the directory to 1001.jpg ..

Reply With Quote
  #3  
Old October 7th, 2002, 01:39 PM
sschmuck sschmuck is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Brooklyn,NY
Posts: 4 sschmuck User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to sschmuck Send a message via AIM to sschmuck Send a message via Yahoo to sschmuck
does that really increment the variable?
try $yourVariable++ or $yourVariable+=1 -- not $yourVariable+1

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > getting some file name that doesnīt exist in dir


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT