Upload path for images

Status
Not open for further replies.

as4s1n

New Member
Messages
174
Reaction score
4
Points
0
Ok, so i'm hosting a site contest to get a new banner for my site, cuz i want to get the people involved. I'm using

PHP:
define('DC_UPLOADPATH','images/Banner_contest');

what would be the correct upload path if i want to put it in images/Banner_Contest folder?
 

as4s1n

New Member
Messages
174
Reaction score
4
Points
0
Well the way i learned how to do it was

PHP:
define('DC_UPLOADPATH','foldername');

 if(move_uploaded_file($_FILES['screenshot']['tmp_name'], $target)){}

but thats just how i learned it.
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
252
Points
63
Yeah, you're doing the same thing I mentioned. I don't get what you're defining though. Google has no idea either :p
 

as4s1n

New Member
Messages
174
Reaction score
4
Points
0
well the define() is basically an array, a long way to put $var

i
PHP:
define('variable','value');

then i refrence it in any other statement

echo "uploadpath: ".variable." ";
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
252
Points
63
Oh, I see now. You didn't use your defined variable in your previous post, that's why I was confused.
 
Last edited:

as4s1n

New Member
Messages
174
Reaction score
4
Points
0
oh sorry,
PHP:
 if(!empty($image)){
  $target = DC_UPLOADPATH . $image;
 }
 else {
  $target = '';
 }

i define the uploadpath in this if/else statement to check if there was an image or not

Anyway...

Whenever i test the send in and i go to my next page to send it in, it always turns up blank, and i have a whole bunch of code to tell me what's wrong, but nothing, blank page o_O i'm stumped
Edit:
Thanks for the help, i got it figured out
Edit:
Just one more question, is there a way to append a variable to the beginning of the file. something like:

PHP:
$name = $_REQUEST['name'];
$banner = $_FILES['banner']['name'];
$baner2 = "$name_$banner";

I tried that and it didn't work and i'm not sure why. It still lets it into the database but the uploadpath is... askew and i don't understand...
 
Last edited:
Status
Not open for further replies.
Top