Welcome to WebmasterWorld Guest from 22.214.171.124
In my html form, I have the following lines:
<form action="myform.php" method="post">
<input type=hidden name="id" value="SERVER['REMOTE_USER']">
<input type=submit value="submit">
But, when I send the above to my php script:
it just outputs server remote user, but not the username. Any suggestions? Thanks.
[PHP]Your user id is <?=$_SERVER[\'REMOTE_USER\']?>.[/PHP]
Maybe it won't work because the php file's on a different server that doesn't require authentication?
I can get the username via a cgi script, so, I guess the solution, for now, would be to get it that way and then pass it on the php script. I was just trying to get away from having to use the cgi. Thanks for your help.
...capture his/her username on my html form and then send it as a hidden value to the php script, which is on a different server...
<note to self>Read a little more carefully next time</note to self>
The php code <?=$_SERVER['REMOTE_USER']?> is in an html file running on a server that doesn't parse php, so the php code isn't going to do anything. The html code is doing what it ought to: sending the value of 'id', literally <?=$_SERVER['REMOTE_USER']?>, to the second server.
> I can get the username via a cgi script...
Thought it might have to do with <Limit Get> in my .htaccess file, but when I changed to <Limit Get Post>, I still wasn't able to capture the remote_user name.
Luckily, the number of people completing this particular survey is small (31) so I'll probably wind up just creating a table and reentering all access codes there.