hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : Need some php help please :)
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

Need some php help please :)

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 06-16-2005, 11:00 AM
Directory Directory is offline
Disabled
 
Join Date: May 2005
Location: UK
Posts: 139

Need some php help please :)


Hi

I downloaded this file : http://www.phpsimplicity.com/scripts.php?id=3

its a upload script, what it does is simply upload, but i wanted to add a field to RENAME the file before fulle uploaded and make the field COMPULSARY!

i just asked the maker of the script, he was in a hurry to leave city because he was going on holiday, so he told me i need to edit

Quote:
if(@move_uploaded_file($_FILES['SFUfile']['tmp_name'][$i], $fullname)) {
(FROM upload.php)

but i still dont get how do i add the field in the first place to allow me to edit it! i checked, the veriable $fullname is the varibale which i need to make the form change the name to, but i dont know where to edit, the script is abit wierd to edit!

it would be just amazing if someone was to tell me how to add another field under or beside the upload field to rename a file and make it compulsary.

Thank you very much

Reply With Quote


Sponsored Links
  #2  
Old 06-16-2005, 11:53 AM
Jeanco Jeanco is offline
Web Hosting Guru
 
Join Date: Aug 2003
Posts: 266
just add a text field to the form and name it newName. Then just replace $fullname with $POST_['newName'] in that line.

Reply With Quote
  #3  
Old 06-16-2005, 02:01 PM
Directory Directory is offline
Disabled
 
Join Date: May 2005
Location: UK
Posts: 139
i tried that code... it did compile it, BUT when i upload a file, it DOES upload, but at the end just cancels! i think its because i cant change the name, so the file isnt fully uploaded, but it did check IT does upload, but wont change the name!

Any other ideas?

Reply With Quote
Sponsored Links
  #4  
Old 06-16-2005, 02:28 PM
Jeanco Jeanco is offline
Web Hosting Guru
 
Join Date: Aug 2003
Posts: 266
Well I don't have time to look into it right now, but another way to go is to upload it using the old name, and then once its successfully uploaded you can call a couple lines of code that rename the folder on the server (as opposed to renaming before upload).

Reply With Quote
  #5  
Old 06-16-2005, 05:02 PM
Rman2003 Rman2003 is offline
Web Hosting Master
 
Join Date: Dec 2003
Location: ./Southest Missouri
Posts: 601
Ok, so I had a little free time today. Consider this my "doing things for others contribution of the day.

Just replace the functions.php and upload.php files with the ones included in this .rar file. Uploaded and tested already on my own server.

Enjoy.

Reply With Quote
  #6  
Old 06-16-2005, 07:41 PM
Directory Directory is offline
Disabled
 
Join Date: May 2005
Location: UK
Posts: 139
WOW, you are too kind. I cant thank you enough. Works perfect like you said.

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?