Page 1 of 1

Upload System

Posted: Wed Aug 14, 2013 6:16 am
by chris98
Hello, I am currently creating an upload system, and I am trying to get a variable into the upload directory.How could I do this?

As you can see below, I have tried several ways, and none seem to be working.Once I remove the variable and replace it with normal text, it works.I have three or four sections, so I don't really want to be creating one for each when I could get it in one, so how could I get it to work?

NOTE: The variable $data_name is the name of my database.The user is asked to select their category via a dropdown box, and then the selected one sends it to that specific table in the database.All the variables do definetly work, as I have tried them.Many many times...

Code: Select all

$minimap_uploadLocation = "c:/wamp/www/strongholdcrusader/downloads/categories/$data_name/pages/minimaps/\\";

Code: Select all

$minimap_uploadLocation = "c:/wamp/www/strongholdcrusader/downloads/categories/".$data_name."/pages/minimaps/\\";
Once I replace either of these ways with the following, it works.

Code: Select all

$minimap_uploadLocation = "c:/wamp/www/strongholdcrusader/downloads/categories/shc_cbuploads/pages/minimaps/\\";
Initially, I tried this, but then soon realised that it wasn't going to work.

Code: Select all

$minimap_uploadLocation = "../categories/".$data_name."pages/minimaps/\\";

Re: Upload System

Posted: Wed Aug 14, 2013 8:46 am
by Celauran
So you've confirmed that

Code: Select all

$minimap_uploadLocation = "c:/wamp/www/strongholdcrusader/downloads/categories/$data_name/pages/minimaps/\\";
contains the correct value?

Can you elaborate on 'not working'? How are you trying to upload the files? What error message(s) are you getting?

Re: Upload System

Posted: Wed Aug 14, 2013 11:35 am
by chris98
I'm not getting any errors, It is uploading them into a database, and I am using only php, no javascript.It adds the name of the upload into the database, because I have seen it in the admin area, but it won't UPLOAD the file.

Re: Upload System

Posted: Wed Aug 14, 2013 12:38 pm
by requinix
You may be getting errors but just can't see them. Find your php.ini and set

Code: Select all

error_reporting = -1
display_errors = on
restart the web server, and try your script again.

Re: Upload System

Posted: Wed Aug 14, 2013 12:42 pm
by chris98
This is on a localhost -- and I have restarted it this morning.I'll try the error reporting.