Jump to content

PHP accessing login information from ASP?


Jessica

Recommended Posts

I have a client who has a current login script which is written in ASP. She wants me to add a new form to it, and it would need to access the username and password. (I assume they are stored in the session the same way as we would in PHP)

 

Is this even possible? Would I just access the session like usual?

Link to comment
Share on other sites

No you can't but there is a work around.

You can set the PHP engine to parse ASP pages as well (anything in <% %> is parsed by the ASP engine, and anything in <?php ?> is parsed by the PHP engine).

Once you have this set, then all asp pages are also ran through php's parser to look for any php code.

Just have php then set a session (IN PHP) as well so you will have access to it.

You can even set the PHP parser to parse asp file's using htaccess like this

AddType application/x-httpd-php .asp

Give that a try, in your htaccess file.

Then where the session in ASP is being created, right below that just register the session variables with PHP too, so php can then work it's magic wherever you need on other PHP pages.

Link to comment
Share on other sites

This ASP code set the session var 'xyz' to "users_name", simulating a login

<%
session("xyz") = "users_name"
%>

 

Set up a simple ASP page to output the session data and put on clients site eg "getxyz.asp"

<%
response.write(session("xyz"))
%>

 

The nice thing about AJAX is that it doesn't care what flavour the the target URL comes in, it just gets whatever was written to stdout.

 

Set up an xmlhttp request calling the above page and pick up the output.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.