Jump to content

trying to echo username from ASP developped 'AuthentiX' (Basic Authorization)


aeroboy

Recommended Posts

Hello,

I am coding a forum for my work (government job) and I am stuck trying to display a user's name.  I have my server computer right in front of me (care of my employer) with the following installations:

IIS v 6.0 - which is reading the files with .php extensions using C:\php\php-cgi.exe (in IIS Manager | Web Service Extensions).
php 5.1.4
MySQL 5.0.22
AuthentiX (Basic Authorization software from Flicks Software)

Essentially, an unprotected (accessible to anyone) login screen links the user to the forum at which time they enter their username and password in a pop-up window (all maintained by AuthentiX).  Access is allowed or granted appropriately.  Once in my site (all .php), I want to echo the user's name back to them, so they know the forum knows who they are. 

AuthentiX provides this option using the following script:

<%
Set AuthX = Server.CreateObject("AUTHXOCX.AuthXOCXCtrl.1")

currentUser =
AuthX.Base64UserName(Request.ServerVariables("HTTP_AUTHORIZATION"))

response.Write "currentUser = "

response.Write currentUser
%>

Since this is in the ASP language, I made a file called username.asp and protected it using AuthentiX (so as to allow access ONLY by login).  I login, am granted access, and then the username.asp spits out at me my username.  All is good.

I can't seem to get my forum.php page to read my username.asp page.  By searching forums, and looking around the internet, I have narrowed down that I have to use something like

fopen() or include()
to access the .asp file, and then
preg_match() or strpos() or something else to parse it and look for a match.  Whenever I try to run my forum.php page with the above ASP script embedded, it gives error messages. 
I altered php.ini in the following ways:

asp_tags = On (it was Off before)

include_path = ".;c:\php\includes;MY_WEBPAGE_DIRECTORY" (MY_WEBPAGE_DIRECTORY was not there before)

After turning on asp_tags, I would have assumed that a .php file would have been able to have <% tags embedded in it - otherwise, why would that option be there?
After altering the include_path, I thought the include() and fopen() functions would have worked, but they didn't either. 

Is there some easy way to translate this ASP into php, so that I could just use that in my forum.php page, and sidestep all ASP completely?  Must I use include()?  Is it my security setting that are hindering things?

I have been in contact with the developper of Flicks Software.  He got me as far as the ASP code.  After that, he said he has no clue about php and how to use it (poor guy).  So he's out as a resource. 

Any help would be very much appreciated.  :-[
Thanks in advance.
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.