Steven
Posts: 15
|
Posted: 08/09/2004, 5:45 AM |
|
It always annoys me when i am filling in forms, and I know I am logged into a website, why parts of the forms are not prefilled with my info, on opening the page, this is an example of how to prefill forms with codecharge
these are to go into the on page open properties page
// prefill an email address
$useremail = dlookup("users","email","user_id=".get_session("UserID"));
if ($fldemail!=null) {
$fldemail = "Type the email address here";
}
else {
$fldemail = $useremail;
}
// prefill a website or homepage
$website = dlookup("users","website","user_id=".get_session("UserID"));
if ($website!=null) {
$fldlink_url = $website;
}
else {
$fldlink_url = "http://www. Type the weblink url here";
}
// prefill a username
$getname = dlookup("users","first_name","user_id=".get_session("UserID"));
if ($getname!=null) {
$fldname = $getname;
}
else {
$fldname = "Name goes Here";
}
same could be done for dates, tel numbers, etc etc
on pages where you want the person only to be able to edit notes or comments about themselves, their busines etc, and not have access to edit the usernames, dates, emails
set those form items as labels, not textboxs. and in the page open properties set the $flds to auto fill with the needed details
$fldemail = dlookup("users","email","user_id=".get_session("UserID"));
Hope this helps
Steven Dowd
_________________
|
|
|
Steven
Posts: 15
|
Posted: 08/09/2004, 5:52 AM |
|
In the above examples, it could be simpler but i bother to do the search for the parameter
$getname = dlookup("users","first_name","user_id=".get_session("UserID"));
because after this is done the once. i can then use $getname in any other part of the scripts
so i could have
echo "welcome". $getname;
etc, without having to do the lookup again
Steven Dowd
_________________
|
|
|
Luke English
|
Posted: 07/26/2005, 11:54 AM |
|
Hi
ive read your articles above, however im still confused. i need to make a database that has two tables in it. one table stores contact info, whilst the other stores booking info. when i type in the contacts ID in a field of the booking info table, i want the name,telephone etc fields to be filled in automatcily by extracting the data from the other table.
how do you do this?
thanks
mr english
ps can u email me a copy of your replies toenglishl1989@blueyonder.co.uk thanks!
|
|
|
|