PDA

View Full Version : Need the user to be able to send $username to a database


BaldNut
09-29-2002, 01:42 PM
Right the end result is that im offering my users to take part in a challenge (slimming) if they are interested i want them to just press a button that would say "Join 8 Week Challenge" upon pressing the button i would then either recieve there username via e-mail or the preffered choice would be that it would automatically be displayed on a page via the database, so as people join everyone can see who is gonna be on the challenge, and this minimises my work dealing with loads of emails also.

So i need to know how i would create a link that upon pressing logged in users $username would be sent to either the database or to email, without them typing there username in.

And if they where not logged in or not registered it would divert them to the not logged in or register page?

Anyone got any ideas how to do this?

My m8, came up with this as being the kind of thing we want to do: <input name="username" type="hidden" value="<php echo $username; ?>">

BaldNut
09-29-2002, 01:45 PM
and i dont know if it would be possible but could a script also work to change the users user group to a usergroup i select upon pressing the link

ie: when they submit the button to do the 8 week challenge the then enter the user group called "8 week challenge" ?

FlyingDutchman
09-29-2002, 02:03 PM
the easiest thing you could do i think is adding a row to the users table, so that when they have pressed the button it would say 1

then it would be fairly easy to make a new file which retrieves all the usernames of the users who have the value 1 on the row competition...

you'll need to reset everything every week however... but that would be a simple function too :)

if this is what you want, i'll make it for you 1,2,3 :)

BaldNut
09-29-2002, 02:11 PM
that would be excellent m8, yes :)