php Forms

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
crai8088
Forum Newbie
Posts: 5
Joined: Wed Jul 26, 2006 9:56 am

php Forms

Post by crai8088 »

HI There,

I am trying to create a html based form that works with a mysql database and intergrates with my phpbb2 forum. What i cant figure out is how to get the username auto filled.

Basically i would like it so that once the page is loaded the username is recognised and auto filled or they are redirected to a log in page?

Any help would be appreciated?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

There is a fairly common startup code that all the phpbb pages run. Use it, and you should have access to the user data.
crai8088
Forum Newbie
Posts: 5
Joined: Wed Jul 26, 2006 9:56 am

Post by crai8088 »

Yes i have access to the user tables.

However what i cant figure out is what to use to auto fill the Username Field?

<form name="form2" method="post" action="">
<input name="textfield" type="text" value="$username">
</form>

that is what i have at the moment however the $username is not auto filling i know this code is wrong any ideas how to fix it?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The startup code creates an array $userdata.
crai8088
Forum Newbie
Posts: 5
Joined: Wed Jul 26, 2006 9:56 am

Post by crai8088 »

Well i finally got the auto fill to work Thanks

Could you be kind enough to help me with this next bit?

The form is working fine now and inserting the data into a table now i want it to remeber this data and autofill in the fields that a person has previously filled in when the revist the form.
$BYB_ID = $userdata['username'];
$DOYLES = $byb_players['DOYLES']
The $BYB_ID works fine this is the username that is autofilling the second one is not working this is in a different table than the 1st. I think i need to set up an array for this but am not sure does anybody know how to do it?

Thanks
Post Reply