Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
autofill fields from logged in user
Old 10-12-2007, 10:09 AM autofill fields from logged in user
Average Talker

Posts: 15
Trades: 0
Hi

trying to get my head round this problem.

ive got a login form working. once the users logged in it presents them with a form to be filled in. I want the users email and telephone to be automatically filled in from the data held in the mysql db. ive searched online and many books but cant find a solution for this.
monkeymafia is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-12-2007, 10:46 AM Re: autofill fields from logged in user
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
Why not log the IP or use a cookie to refer the the user ID in the MySQL.

Though, it tends to not be a good idea to have stuff filled in for people, it helps hackers.
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 10-12-2007, 10:50 AM Re: autofill fields from logged in user
Average Talker

Posts: 15
Trades: 0
okay i never considered that. thanks alot for your help!
monkeymafia is offline
Reply With Quote
View Public Profile
 
Old 10-12-2007, 11:07 AM Re: autofill fields from logged in user
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
Heh, Books always give you an example way...not always the best way.

I found with the book I learn PHP from, I needed to work from it and try to do mini projects (for example, MySQL > Page and Array > Table) to really learn.
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 10-12-2007, 12:22 PM Re: autofill fields from logged in user
Foundationflash's Avatar
Ultra Talker

Posts: 410
Name: Harry Burt
Location: Colchester, Essex, England
Trades: 0
You always have to try these things out. PHP is more difficult in that respect - most other languages are more viewable. eg. view source etc. Books never quite tell you exactly what you want to know, I think.
__________________
Foundation Flash tutorials :
Please login or register to view this content. Registration is FREE


New Dreamed Up Web Design:
Please login or register to view this content. Registration is FREE
Foundationflash is offline
Reply With Quote
View Public Profile Visit Foundationflash's homepage!
 
Old 10-12-2007, 12:45 PM Re: autofill fields from logged in user
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
this is a simple query to get the info

PHP Code:
$result = mysql_query("SELECT * FROM users WHERE id='$user_id'");
$row = mysql_fetch_array($result);
 
?>
<input type="text" value="<? echo $row['users_email'?>" name="email" />
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Reply     « Reply to autofill fields from logged in user
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24303 seconds with 12 queries