![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Master of Gfy.com
Industry Role:
Join Date: Feb 2002
Posts: 14,887
|
Need php help, quick question ;)
I have been building a few things lately for fun, This is a standard upload script, i am having trouble renaming the file, where in the code do i need to change so that i could have a random name or base the name off an Id?
$target_path = "uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Jun 2006
Posts: 530
|
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
the bold part is where you would place the name |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Sofa King Band
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
|
The filename is set here: basename( $_FILES['uploadedfile']['name'])
$target_path = $target_path . 'thenamethatyouwant.jpg'; You can have it be what you want, you aren't forced to use the name that the file was uploaded with. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Master of Gfy.com
Industry Role:
Join Date: Feb 2002
Posts: 14,887
|
ahhh ok! so could i put a variable right there, if i was trying to name it based off an ID? like if the id is 16, its going to be 16.jpg?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
:glugglug
Join Date: Mar 2003
Location: Where the Wild Things Are
Posts: 26,118
|
Pipecrew, off topic, but does Bang Bros know that something is wrong with the way they're tracking hits? I'm showing way less hits than normal for the past few days. Did you guys make some changes to the way you count hits? Are sales still being tracked normally?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Too lazy to set a custom title
Industry Role:
Join Date: Sep 2003
Location: Canuckstikan
Posts: 22,722
|
Yo Pipecrew can you hit me up on ICQ when you have a second please. 124588247
__________________
Wowify AI API Porn.AI Affiliates Porn AI email: [email protected] Teams: jean.francois.laverdiere TG: @jman1216 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Sofa King Band
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
|
Yup, could be what ever you want... and a variable would be a good idea since you use basename( $_FILES['uploadedfile']['name']) in your success message as well.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Master of Gfy.com
Industry Role:
Join Date: Feb 2002
Posts: 14,887
|
Quote:
J/k, not in a hundred years, yes we know there is a problem and its being fixed. We had a database issue on bangbrosnetwork over the weekend and the people that wrote our affiliate software have been working on everything allday, there will be a redump of all data tommorow am. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
:glugglug
Join Date: Mar 2003
Location: Where the Wild Things Are
Posts: 26,118
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Master of Gfy.com
Industry Role:
Join Date: Feb 2002
Posts: 14,887
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 | |
Sofa King Band
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
|
Quote:
And Masterchief was correct as well. ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Pounding Googlebot
Industry Role:
Join Date: Aug 2002
Location: Canada
Posts: 34,469
|
I didn't know you were a coder
![]() WG
__________________
I play with Google. |
![]() |
![]() ![]() ![]() ![]() ![]() |