Authorization to Upload image

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
inor.y
Forum Newbie
Posts: 6
Joined: Fri Nov 21, 2003 5:42 am
Location: Philippines
Contact:

Authorization to Upload image

Post by inor.y »

I'm a newbie in PHP and still learning.

I have a problem in uploading image to the website. I have an admin username and password to access the website, but I do not know how to use it to allow uploading image to the website. I tried the code in virtual server as localhost on my computer. It works but when I upload the code to the server, it gives an error.

Can somebody out there help me.

It's been days trying to research on the problem, and I give up.
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post by DuFF »

What kind of login system do you have? .htaccess, sessions or cookies?

For help with file or image uploading check out the php.net manual:
http://www.php.net/manual/en/features.file-upload.php
inor.y
Forum Newbie
Posts: 6
Joined: Fri Nov 21, 2003 5:42 am
Location: Philippines
Contact:

Authorisation on File Upload

Post by inor.y »

Duff,
Sorry but I was out of town I just got in and read ur reply. Thanks for ur time. Right now I dont use authentication but on my other projects I used a database to authenticate users using forms plus a cookie to monitor access.

I read that .htaccess provides read/write access to a directory on the web server. But I dont know how to edit nor access the file.

The web site contains product pics and it has to be uploaded in a directory on the web server. I made an admin page to upload the pics, but it requires that I have write access to the directory. If i use .htacess it would allow the directory to be seen and uploaded by anybody. How do I go about this problem. I have a probable solution to convert all my pics to binary and store in the database, but I may have to re-program a lot of pages.

If I can only code something that I embed the admin access to the site upon authenticated that the login is authorized, probably I can send this command to the server so I can write on the directory. I am creating an on-line store where I create my own shopping cart. Actually this is just one of my problem. The other is I dont know how to do an IPN test on the checkout routine. Maybe somebody can help me out.

It would be highly appreciated if I can upload the web site before Christmas.

Thanks for ur help. More power to this site.
Post Reply