Google Answers Logo
View Question
 
Q: Cookie Problem ( No Answer,   3 Comments )
Question  
Subject: Cookie Problem
Category: Computers > Programming
Asked by: cool_dude_208-ga
List Price: $10.00
Posted: 30 Sep 2004 12:59 PDT
Expires: 30 Oct 2004 12:59 PDT
Question ID: 408497
Hi there,
  I have a site which works with ASP technology. Can some one help me
how can i get the login name with which the user has logged into the
site using PHP script. I can only make links on this asp site which
can lead me to a different page where i can display the login name.
I need it only in php. I dont want it to be in ASP.
If possible can you include script for that purpose.
Thanks.

Clarification of Question by cool_dude_208-ga on 01 Oct 2004 09:03 PDT
Iam using HTTP authentication.
Answer  
There is no answer at this time.

Comments  
Subject: Re: Cookie Problem
From: indianguysiva-ga on 01 Oct 2004 02:45 PDT
 
how you are accepting the username and password.

are you using http authentication or your own page design.

regards
indianguysiva
Subject: Re: Cookie Problem
From: hscbaj-ga on 13 Oct 2004 03:35 PDT
 
Hi there,
I am a professional ASP and PHP programmer.

In ASP, if you wish to just request the username from the HTTP
authentication then you can request it like this...
<%
dim username
username = Request.ServerVariables("AUTH_USER")
response.write "This user logged in with the username " & username
%>
If you want to find more out about server variables, Microsoft has a
great guide here http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/iis/servervariables.asp

However, if you want to request the HTTP authenticated username in
PHP, do it as follows
<?php
// this if statement checks to see if the user has logged in via HTTP
authentication
  if (isset($_SERVER['PHP_AUTH_USER'])) {
    echo "This user logged in with the username " . $_SERVER['PHP_AUTH_USER'];
  }
?>
You can find out more about it from phpbuilder here...
http://www.phpbuilder.com/manual/features.http-auth.php


I hope this answers your question fully.
Subject: Re: Cookie Problem
From: binary_zero-ga on 21 Oct 2004 09:55 PDT
 
humm ! 
still confuse with your schema, but i am writing some code here for
getting username onto a PHP page.

ok now on ASP Page you can make some link like this or in simple HTML.

==========
SOMETHING.ASP
==========

<A href="sample.php?USER=<?=user or from session variables   ?>"> SomeLink </a>

finaly in browser it will be some thing like this : sample.php?USER=deeds


in sample.php   we are going to print or do something with that username.

==========
SAMPLE.PHP
==========

<?php

$variable = $_GET['USER'];
echo $variable;

?>



this is a simple code some how, you can let me know your exact requirments.
just for info $_GET[] variable contains all the variable passed via GET Method.

regards,
s.ahmad

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy