Choose picture in server

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
xionhack
Forum Contributor
Posts: 100
Joined: Mon Nov 10, 2008 9:22 pm

Choose picture in server

Post by xionhack »

Hello. I have a register form and in the form, the person can choose a picture that they like. The only thing is that the picture is not going to be uploaded but its already in the server and they have to choose it from the server. How can I do that? Thanks!
minorDemocritus
Forum Commoner
Posts: 96
Joined: Thu Apr 01, 2010 7:28 pm
Location: Chicagoland, IL, USA

Re: Choose picture in server

Post by minorDemocritus »

I would create a simple gallery with radio buttons, and have that as part of the form. Use something like this:

Code: Select all

<input type="radio" name="picture" value="pic1" /><img src="pic1.png" /><br />
<input type="radio" name="picture" value="pic2" /><img src="pic2.png" /><br />
<input type="radio" name="picture" value="pic3" /><img src="pic3.png" /><br />
Then in the form processing script, check the value of $_POST['picture'] or $_GET['picture'] for the result.
Post Reply