News:

Wondering if this will always be free?  See why free is better.

Main Menu

how do i add peoples usernames to a script?

Started by steve51184, January 27, 2010, 09:23:47 PM

Previous topic - Next topic

steve51184

hey all i have this script and i want to know is there a way i can have the value="" bit of the 'from' imput box auto filled with the users username?

<form action="http://pushme.to/myusername/" method="POST"><input type="hidden" name="_encoding" value="UTF-8"></input>Message: <input type="text" name="message"> From: <input type="text" name="signature" value=""/> <input type="submit" value="Push"/></form>

hadesflames

Assuming this is a custom php page, include SSI.php then global $context and you would have something like:


<?phprequire_once('path/to/SSI.php');global $context;echo '<input type="text" name="name" value="' . $context['user']['username'] . '" />';?>


hadesflames


steve51184

hey if this is for usernames how do i show display names?

$context['user']['username']

Advertisement: