Setting up an avatar script???

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
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Setting up an avatar script???

Post by Joe »

Recently I have being trying to develop a sign up script that allows you to choose an avatar from a small selection list. When the user likes that avatar they simply check that box but the part I am clueless to is how to identify the location of that avatar using PHP for putting into the mySQL database for future use. Below is a small sample of the avatar list:

<td bgcolor="#FFFFFF"><input type="radio" name="avatar" value="1" /><img src="pics/avatars/avatar2.jpg" width="70" height="70" alt="Peace" border="0" /></td>
<td bgcolor="#FFFFFF"><input type="radio" name="avatar" value="1" /><img src="pics/avatars/avatar3.jpg" width="70" height="70" alt="Artist" border="0" /></td>
<td bgcolor="#FFFFFF"><input type="radio" name="avatar" value="1" /><img src="pics/avatars/avatar4.jpg" width="70" height="70" alt="Freedom" border="0" /></td>


Please help???

Regards


Joe 8)
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

It shouldn't be too difficult to modify the script at viewtopic.php?t=16746
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Re: Setting up an avatar script???

Post by d3ad1ysp0rk »

Code: Select all

<td bgcolor="#FFFFFF"><input type="radio" name="avatar" value="2" /><img src="pics/avatars/avatar2.jpg" width="70" height="70" alt="Peace" border="0" /></td>
<td bgcolor="#FFFFFF"><input type="radio" name="avatar" value="3" /><img src="pics/avatars/avatar3.jpg" width="70" height="70" alt="Artist" border="0" /></td>
<td bgcolor="#FFFFFF"><input type="radio" name="avatar" value="4" /><img src="pics/avatars/avatar4.jpg" width="70" height="70" alt="Freedom" border="0" /></td>
then just enter value for the SQL value.. and call it as
<img src="avatars/avatar . $avpath . ">

you could also make it so they can enter a path to one also (their server), but you'd need to add a few things and just print out $avpath and not avatars/avatar$avpath
Post Reply