Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

PHP Scripts in an ASP Page

 
   Web Hosting and Web Master Forums (Home) -> IIS RSS
Next:  localhost problem and virt directories  
Author Message
lance

External


Since: Feb 19, 2004
Posts: 1



(Msg. 1) Posted: Thu Feb 19, 2004 4:11 pm
Post subject: PHP Scripts in an ASP Page
Archived from groups: microsoft>public>inetserver>iis (more info?)

There is a Knowledge Base article (http://support.microsoft.com/default.aspx?scid=kb;en-us;276494) about installing the Python interpreter that seems to suggest Python script can be run on a page with an .ASP extension. (<%@LANGUAGE=Python%>)

Is there any way to configure IIS or PHP to allow the same behavior with PHP? Is so, I believe it would allow mixing VBScript and PHP Code on the same ASP page.

Thank you.

 >> Stay informed about: PHP Scripts in an ASP Page 
Back to top
Login to vote
kenremove

External


Since: Aug 23, 2003
Posts: 2901



(Msg. 2) Posted: Fri Feb 20, 2004 5:11 pm
Post subject: Re: PHP Scripts in an ASP Page [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You can not mix server-side languages on a single page.
I do not believe there is a PHP intepreter available that would allow you to
write ASP pages using PHP.

Cheers
Ken

"Lance Clarke" <Lance.TakeThisOut@cylan.net> wrote in message
news:0285E6C9-5095-4321-B194-52D62679E149@microsoft.com...
: There is a Knowledge Base article
(http://support.microsoft.com/default.aspx?scid=kb;en-us;276494) about
installing the Python interpreter that seems to suggest Python script can be
run on a page with an .ASP extension. (<%@LANGUAGE=Python%>)
:
: Is there any way to configure IIS or PHP to allow the same behavior with
PHP? Is so, I believe it would allow mixing VBScript and PHP Code on the
same ASP page.
:
: Thank you.

 >> Stay informed about: PHP Scripts in an ASP Page 
Back to top
Login to vote
anonymous1230

External


Since: Feb 20, 2004
Posts: 2



(Msg. 3) Posted: Fri Feb 20, 2004 5:11 pm
Post subject: Re: PHP Scripts in an ASP Page [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I have seen it stated several times lately that you can't mix scripting languages on the same page. I was quite surprised to learn this, since I do it all the time. The output of this script:

<%
Response.Write "Written with VB Script from the Server<br>"
%><Script RunAt=Server Language=JavaScript>
Response.Write("Written with Java Script from the Server<br>");
</Script><Script RunAt=Server Language=VBScript>
Response.Write "Written with VB Script from the Server<br>"
</Script><Script Language=JavaScript>
document.write("Written with Java Script from the Client<br>");
</Script><Script Language=VBScript>
document.Write "Written with VB Script from the Client<br>"
</Script>

Looks like this:

Written with Java Script from the Server
Written with VB Script from the Server
Written with Java Script from the Client
Written with VB Script from the Client
Written with VB Script from the Server

It most certainly does work. Thought the output is out of order, it is as expected.

Isn't getting the interpreter to read an ASP page a function of the script mapping? Or does it specifically need to be supported in the interpreter as well?

Thanks
 >> Stay informed about: PHP Scripts in an ASP Page 
Back to top
Login to vote
kenremove

External


Since: Aug 23, 2003
Posts: 2901



(Msg. 4) Posted: Sat Feb 21, 2004 2:30 am
Post subject: Re: PHP Scripts in an ASP Page [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Apologies - you are correct. You can have sections of script within a
<script runat="server"> block.

You can't have different languages within <% %> blocks. The intepreter used
is either the default specified in the IIS metabase, or whatever is
specified in the @Language= page declaration.

The intepreter needs to support whatever threading model (etc) that is
required to be an ISAPI extension. If there's a PHP .exe or a PHP.dll, then
you could certainly try mapping .php extensions to it, but I don't think
it'll work.

You can get more information on ISAPI extensions here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissd...is/isap

Cheers
Ken

"Lance Clarke" <anonymous DeleteThis @discussions.microsoft.com> wrote in message
news:147F38A5-12BF-4D0B-8C52-27DC89B55889@microsoft.com...
: I have seen it stated several times lately that you can't mix scripting
languages on the same page. I was quite surprised to learn this, since I do
it all the time. The output of this script:
:
: <%
: Response.Write "Written with VB Script from the Server<br>"
: %><Script RunAt=Server Language=JavaScript>
: Response.Write("Written with Java Script from the Server<br>");
: </Script><Script RunAt=Server Language=VBScript>
: Response.Write "Written with VB Script from the Server<br>"
: </Script><Script Language=JavaScript>
: document.write("Written with Java Script from the Client<br>");
: </Script><Script Language=VBScript>
: document.Write "Written with VB Script from the Client<br>"
: </Script>
:
: Looks like this:
:
: Written with Java Script from the Server
: Written with VB Script from the Server
: Written with Java Script from the Client
: Written with VB Script from the Client
: Written with VB Script from the Server
:
: It most certainly does work. Thought the output is out of order, it is as
expected.
:
: Isn't getting the interpreter to read an ASP page a function of the script
mapping? Or does it specifically need to be supported in the interpreter as
well?
:
: Thanks
 >> Stay informed about: PHP Scripts in an ASP Page 
Back to top
Login to vote
anonymous1230

External


Since: Feb 20, 2004
Posts: 2



(Msg. 5) Posted: Sat Feb 21, 2004 2:30 am
Post subject: Re: PHP Scripts in an ASP Page [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Maybe it would be easier if I just told you what I'm trying to do.

PHP includes native functions to do both forward and reverse DNS resolution. The PHP script:

<?
echo gethostbyname('www.somehost.com');
?>

Will output the IP address of the host. And that's what I need, to be able to retrieve an IP address in real time and display it within an ASP page.

Currently I have a third-party COM object installed that does DNS, but this seems so much cleaner if I could get it to work. I have considered having the PHP script store the IP to a cookie then just doing a response.redirect into the PHP script and the PHP equivalent back out of it, but I can't help thinking there is a better way.

Thanks for all your help.
 >> Stay informed about: PHP Scripts in an ASP Page 
Back to top
Login to vote
someone9

External


Since: Aug 25, 2003
Posts: 2419



(Msg. 6) Posted: Sat Feb 21, 2004 2:30 am
Post subject: Re: PHP Scripts in an ASP Page [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

<%
Response.Write ( "Client IP: " & Request.ServerVariables( "REMOTE_ADDR" ) &
"<BR>\r\n" )
Response.Write ( "Server IP: " & Request.ServerVariables( "LOCAL_ADDR" ) &
"<BR>\r\n" )
%>

This returns the IP of the client browsing the web page as well as the IP of
the interface on the server that handled the request. If you have a Proxy
in between there, the REMOTE_ADDR is going to show the proxy and not the
actual client, which is expected.

While ASP doesn't have any built-in functionality to do a DNS lookup of
arbitrary location, it is easy to extend via ActiveX/COM, which just about
crosses all MS technologies and can leverage it.

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Lance Clarke" <anonymous.TakeThisOut@discussions.microsoft.com> wrote in message
news:B3B08268-C702-4C51-BB0E-F9132B39D729@microsoft.com...
Maybe it would be easier if I just told you what I'm trying to do.

PHP includes native functions to do both forward and reverse DNS resolution.
The PHP script:

<?
echo gethostbyname('www.somehost.com');
?>

Will output the IP address of the host. And that's what I need, to be able
to retrieve an IP address in real time and display it within an ASP page.

Currently I have a third-party COM object installed that does DNS, but this
seems so much cleaner if I could get it to work. I have considered having
the PHP script store the IP to a cookie then just doing a response.redirect
into the PHP script and the PHP equivalent back out of it, but I can't help
thinking there is a better way.

Thanks for all your help.
 >> Stay informed about: PHP Scripts in an ASP Page 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
need help getting asp scripts to run - I'm trying to get a simple asp script to run and I'm getting the error below. As far as I can tell, IIS is not set up to require a username and password, but accepts anonymous connections. So I'm not sure what the error refers to. Can anyone point me....

How to run CGI scripts on IIS - I have some old CGI scripts that I ran a while ago on another server. How do I run those scripts on a WIN2K server running IIS? What configuration settings do I need to alter? Erik

GET /scripts/nsiislog.dll ???? - Why are people always looking for that?

which scripts folder & dll is used? - Hello, All! Here's an interesting question. I have: \inetpub\scripts\isapi.dll (new version) and (by mistake) \inetpub\wwwroot\scripts\isapi.dll (old version) Which isapi.dll is used in my default web site? -- Eric den Doop www.foxite.com - The Home Of...

scripts directory gone in IIS 6.0? - Hi, Has the Scripts virtual directory been removed from IIS 6.0? In Windows 2000/IIS 5.0, it was Inetpub\scripts. Why has it been removed? What is the workaround to execute scripts? Simply create your own virtual directory, put your scripts in there an...
   Web Hosting and Web Master Forums (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]