![]() |
Image folders problems
Good evening.
I am a new php programmer. :-D I'm developing a website and i need some help. I have an administrative area where i can do some tasks. My problem is when i want to insert for example an image from a new product to show in the main page. I want to put the images in a folder outside the admin area. How can i do that? Thanks ! ;-) |
well you can use the copy() function such would be an example
PHP Code:
|
Or ofcourse through the upload function, put it in your image folder remotely.
You are in: /root/admin/uploadform/ You want to PUT it into: /root/images/uploads your commandline in the index.php from uploadform will be; ../../images/uploads/ Good luck :) |
But then i have a problem.
The path of the image is inserted in the database. insert into product(name, path) ('asoldiasldki','../../images/image.png') When i read, in the main page, i have the "../../images/" when i only want "images/" How do i remove that? |
|
It's working! :D
I used the str_replace(). Thank you all!! |
nice, it might be easier to just store the filename, and then when you need to insert an image somewhere you can easily add the directory structure to the filename variable, it's just a bit more flexible I think.
|
Another (late) idea:
Code:
$image = 'images/' . basename( $image ); |
| All times are GMT. The time now is 05:12 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0