Log in

View Full Version : COMponent in PHP



info_rene
10-01-2010, 06:47 AM
Hi,

I am an ASP developer... and uses a COMponent (under COM+) to access the data. The COMponent (dlls) are coded in Cobol and wanted to access it in PHP but I'm not sure whether PHP has functionalities for COM+

Can anyone give an example of how can I access COMponent in PHP? My intention is to actually migrate from ASP to PHP development. dotNET is quite slow and requires big burden on the web server.

If I am going to access COMponents in ASP, I could always do it by coding (below);



<%
'submit button is clicked
if act = "Submit" then
usrName = trim(request.Form("txtUser"))
usrPass = trim(request.Form("txtPass"))
userIP = request.servervariables("REMOTE_ADDR")
stat = siteObj.checkUserID(usrName, usrPass, userIP, usrSession)
if stat <> "00" then
ioStat = "err"
ioText = "information entered is incorrect....."
else
session.contents("sessionUserID") = trim(usrSession)
response.redirect("okpassword.asp")
end if
end if
%>


where;
stat = siteObj.checkUserID(usrName, usrPass, userIP, usrSession)
is a COMponent (DLL) registered function

and checkUserID(usrName, usrPass, userIP, usrSession) is the function I am calling with corresponding parameters

traq
10-01-2010, 02:17 PM
PHP supports it: http://us2.php.net/manual/en/book.com.php

I've never used it, and it seems to be Windows-only (of course). good luck!

info_rene
10-05-2010, 10:01 AM
PHP supports it: http://us2.php.net/manual/en/book.com.php

I've never used it, and it seems to be Windows-only (of course). good luck!

From the site you posted, it seems that it can be done...

It is just that sometime people who knew PHP are not interested with ASPs. Well, I could attest to it because I myself would like to study PHP
:D