473,324 Members | 2,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

PHP Function To access the Current User who's logged in

Hello all,
I wanted to know if there is a PHP function which could display the name of the user that is currently logged in? Also could PHP code access and execute WIN32 API functions ? Kindly guide me regarding the same.

Regards,
Abhijit
Aug 24 '08 #1
2 4537
Ferris
101 100+
I think you can't do this with Apache alone.

you can run IIS on port 8080 , and run Apache on port 80, and create a ASP or ASPX page to get current User and echo it. Then, you can visit ASP or ASPX page in PHP ,something like fopen("http://localhost:8080/getuser.aspx").
Aug 25 '08 #2
Atli
5,058 Expert 4TB
Hi.

What do you mean by "the Current User who's logged in"?

PHP can execute shell commands, so doing something like:
Expand|Select|Wrap|Line Numbers
  1. $username = exec("whoami");
  2.  
Should give you the name of the user running the PHP service (or the HTTP server service, if PHP is being run as a module).

As to the Win32 API, check out the W32api extension.
Aug 25 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
8
by: Mike Thomas | last post by:
I have two clients now who want to have an Access 2000 & 2002 application running on NT Server 2000 do some file updating at night when nobody is in the office. I have used Windows scheduler to...
4
by: NWx | last post by:
Hi, I' trying to implement a callback method when a cache object expires I want to do this to automatically logout user after a timeout (for demo purposes) My thought is, when user logon,...
3
by: Chris B. | last post by:
I'm getting some strange results in an asp.net web application that has recently gone live. In the header of almost all the pages, the full name of the currently logged in user is displayed. On...
2
by: Shailesh Gajare | last post by:
Hi All, I have creating an ASP.Net application with two web servers. I am uploading a file which is being uploaded on one of the server, I want to copy the uploaded file on the other server at the...
4
by: Kevin Blount | last post by:
My current site uses a ASP, database driven, ID based system to allow people to download files they have the right permissions to, as well as to send an email to them with necessary support links...
5
by: Les Desser | last post by:
I know that the .ldb file should show the users currently logged into a database. However, when a user logs out I cannot detect any change in the file. I must be missing something as PSPad...
5
by: Stinky Pete | last post by:
Hi (again) ;-) I'm still very much at the bottom of a steep learning curve with VB, so any and all help is always appreciated. I've found some code to generate the user names who have logged...
2
by: RSH | last post by:
I have a situation where I have a page called "HiddenFrame.aspx" that contains a public property exposing the value of a textbox called "TextBox1" that is in a hiddenframe. Loaded in the main...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.