Page 1 of 1

Help with images...

Posted: Wed Oct 10, 2007 1:00 am
by CSmith1128
hello.. i have a question..

i have a page where a user can set an image to the background of their profile.

i want to allow them to enter a url that points to the image.

is there anything that can go wrong with doing this, and if so, is there any way to prevent it?



thanks

chris

Posted: Wed Oct 10, 2007 1:47 am
by Luke
You would want to check that the file is actually an image. I believe this function does that... I can't remember. http://us.php.net/manual/en/function.getimagesize.php
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.

Posted: Wed Oct 10, 2007 4:31 am
by Benjamin
Hey...!

Posted: Wed Oct 10, 2007 6:27 pm
by Ambush Commander
There's not much control you can exert on external files: they can always swap it out for something else after your PHP code does the validation. Just have them upload it and then perform some server-side validation!