| | |
getting user info
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
hello all. i am writing a php / mysql script that does various things, but in addition to those things i need it to get the username of whoever is using the front end. any help is greatly appreciated! also i can post some code snippets if you want a feel for what im doing.
Henry Phillips
Web Programmer
Adirondack Area Network, LLC
Web Programmer
Adirondack Area Network, LLC
no. everyone in my office (like 9 people total) has a Unix username they have to use to log into our company website. the website has stuff like a calendar of events, technical info, various forms for things, and it will have the IP database front end i am writing for it. when a user uses this new front end i want it to get his or her username because it will go into a row in the IP table (telling other users who inserted that row of data). does that clear it up a little bit? thanksa.
Henry Phillips
Web Programmer
Adirondack Area Network, LLC
Web Programmer
Adirondack Area Network, LLC
•
•
Join Date: Sep 2006
Posts: 162
Reputation:
Solved Threads: 14
Post (method="post") the html control data e.g. txtusername, txtpassword to your php page. Then on your php page you need to start_session() (or something like that) and then assign a value to the session variable e.g. $_SESSION['varUserName'] = $_POST[txtusername].
Now you can access that variable while the session is live.
e.g.
My php is a bit rusty so it might not be exact.
Now you can access that variable while the session is live.
e.g.
PHP Syntax (Toggle Plain Text)
<?php echo $_SESSION['varUserName'] //output user name ?>
My php is a bit rusty so it might not be exact.
•
•
Join Date: Sep 2006
Posts: 162
Reputation:
Solved Threads: 14
It's not too difficult. Say you had a login page with two text areas (username and password) and a button (submit) you would use an HTML form like this...
<form method="post" action="authenticate.php">
username
<input type="text" name="txtusername">
password:
<input type="password" name="txtpassword">
<input type="submit" value="submit" name="btnsubmit">
</form>
When you click submit the text box input is sent to authenticate.php.
<form method="post" action="authenticate.php">
username
<input type="text" name="txtusername">
password:
<input type="password" name="txtpassword">
<input type="submit" value="submit" name="btnsubmit">
</form>
When you click submit the text box input is sent to authenticate.php.
i really dont wanna do that because when the user is using my IP database front end they will already have logged in to the server (//gothics). im asking how i can get that information that they've already given the server so i can identify who is making what modifications to the IP database. is there a way to do that? sorry if im being a pain.
Henry Phillips
Web Programmer
Adirondack Area Network, LLC
Web Programmer
Adirondack Area Network, LLC
![]() |
Similar Threads
- create shortcut to run as a different user (Windows NT / 2000 / XP)
- Quick Reference for Linux Commands (Getting Started and Choosing a Distro)
- Querying User for Info (PHP)
- Linux Unable to log in with newly create user (IT Professionals' Lounge)
Other Threads in the PHP Forum
- Previous Thread: Retrieving and comparing data from arrays
- Next Thread: want to access my database from remort place
| Thread Tools | Search this Thread |
apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql number oop parameter paypal pdf php phpincludeissue problem query radio random recourse recursion regex remote script search seo server sessions sms source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white wordpress xml youtube





