Page 1 of 1

PHP include in ASP

Posted: Thu Oct 25, 2007 8:52 am
by Becca800
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I have a PHP script that I am trying to include in asp.  Most people say you can not do this but actually you can by using this include:

[syntax="asp"]<%
Dim objHttp
set objHttp = Server.CreateObject("Microsoft.XMLHTTP")
objHttp.open "POST", "http://www.yoursite.com/ad/comments/comments.php", false
objHttp.Send
If objHttp.status = 200 Then
response.write(objHttp.responseText)
End If
set objHttp = nothing
%>
I found this code and it works great.

However, the script calls for one the url variable to be assessed by using the function:[/syntax]

Code: Select all

<input type=hidden name="href" value="{$_SERVER['REQUEST_URI']}">
Instead of getting the correct url of the asp page in which it is inserted, it records the url from the insert: http://www.yoursite.com/ad/comments/comments.php I have done tests by inserting this into test php files, and of course, it works fine, so it is the insert method I am using above which is giving it trouble.

I am not a php expert, I know very little, I only know basic html so if you have any thouhts you might need to literally draw it out for me. I found one post in another forum which was similar and someone said that the person needed to add get variables but I didn't know what this meant.

Thank, Becca


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]