Image upload problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
CyrusJax
Forum Newbie
Posts: 3
Joined: Fri Sep 25, 2009 3:51 am

Image upload problem

Post by CyrusJax »

Hi all,

Having a bit of a problem with an image upload page ive created. basically i have an admin control panel ive created for my site. you login and can add items to the main site. now the file directories look like this:

home/images/items < This is where the item images should go
home/admin/ < this is where the admin control panel is based.

Now when i load up the admin page and go to upload an image I need to go back a directory and into the images/items directory. So for my new location variable ive tried using:

$newname = "..\images\items\\" . $newfilename . "." . $ext;
ive also tried:

$newname = ".\images\items\\" . $newfilename . "." . $ext;

but neither work, they just create the image as ..blarblar.jpg

this worked fine on my localhost but now it is live on my webhost this what happens, this is probably quite simple. any help is much appreciated!
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Image upload problem

Post by jackpf »

Is your web host on windows?
CyrusJax
Forum Newbie
Posts: 3
Joined: Fri Sep 25, 2009 3:51 am

Re: Image upload problem

Post by CyrusJax »

Good question, I would have to say no, i believe its a linux distro of some kind. I only have access to it via a control panel.
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Image upload problem

Post by jackpf »

You could try using forward slashes then ;)
CyrusJax
Forum Newbie
Posts: 3
Joined: Fri Sep 25, 2009 3:51 am

Re: Image upload problem

Post by CyrusJax »

thanks very much that seems to have done the trick! :)
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Image upload problem

Post by jackpf »

Cool, no problem.
Post Reply