jonam has asked for the wisdom of the Perl Monks concerning the following question:

I used a perl program to get the login name of the user. I included that perl program in PHP code. It prints the user name when I run that code using php(command). But it does not print the login name in browser when I run. How can I get the login name of the user in perl that can print the name in browser?

Replies are listed 'Best First'.
Re: perl in php
by CountZero (Bishop) on Mar 14, 2009 at 07:52 UTC
    I found this in a very old posting on PHPBuilder:
    <html> <head> <title>Test</title> </head> <body> <?php $username = str_replace("DOMAIN\\\\", "", $_SERVER['REMOTE_USER' +]); ?> Hello <?php printf("$username"); ?>, and welcome! </body> </html>
    I have no idea if it (still) works, but you can give it a try.

    PHP has (at least) the following commands to run an external program:

    Did you give these a try?

    Update: added a list of PHP commands with links to the docs.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re: perl in php
by jonnyfolk (Vicar) on Mar 14, 2009 at 07:42 UTC
    It's difficult to imagine what you might have done or tried. Could you give us a clue?
Re: perl in php
by irah (Pilgrim) on Mar 14, 2009 at 08:23 UTC

    When you are working in shell, it may execute as server side program. It will give what do you expect. But when you are executing in browser, it may execute as client side program.

      its near impossible to encounter a browser supporting client side php