Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 PHP Include question
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

ASPDude
Starting Member

United Kingdom
41 Posts

Posted - 25 March 2003 :  04:53:01  Show Profile  Visit ASPDude's Homepage
I have a small PHP page that I wish to include in my portal_content.asp page. The PHP page is an RSS feeder that works perfectly by itself but when I include it in my portal_content.asp page all it displays is the PHP code.

I'm bringing the page in as such:

<!-- #include file="newsfeeds/onyx/onyx-test.php" -->

Now I'm not sure if this is how you call an PHP page into an ASP page (or if you can even do it) so any advice is welcome.

Thanx

dayve
Forum Moderator

USA
5820 Posts

Posted - 25 March 2003 :  10:30:00  Show Profile  Visit dayve's Homepage
calling PHP into an ASP page? I don't think that is possible, and besides PHP includes look something like this:

<? include("file.php"); ?>

Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 25 March 2003 :  11:10:43  Show Profile
dayve is correct, you can't include a php page in an asp page. The asp interpreter doesn't know what to do with php code. Maybe an IFrame or something like asptear can get the contents of your php page (this assumes the php page is still on a php-enabled server somewhere).

======
Doug G
======
Computer history and help at www.dougscode.com

Edited by - Doug G on 25 March 2003 11:11:16
Go to Top of Page

ASPDude
Starting Member

United Kingdom
41 Posts

Posted - 25 March 2003 :  11:32:13  Show Profile  Visit ASPDude's Homepage
Thanx guys

Funny feeling that was going to be it. After I posted this I checked thru the archive again and found a similar plea from Ru55ian and he was told similar.

Sorry to have wasted time here guys, but at least I've learned my something new for today!
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 25 March 2003 :  12:53:37  Show Profile  Visit dayve's Homepage
I have an RSS Reader that I was using XML integrated within my forum, are you interested in using something like that?

Go to Top of Page

ASPDude
Starting Member

United Kingdom
41 Posts

Posted - 27 March 2003 :  11:20:54  Show Profile  Visit ASPDude's Homepage
dayve

Very much so. Could you either mail me or direct me to get the code.

S
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 27 March 2003 :  11:27:18  Show Profile  Visit D3mon's Homepage
Couldn't you (assuming you had a recent version of IIS) have a
server.execute("myfile.php")
in an ASP file?

(not that I'd want to, but in theory it should work if the MIME type is correctly set.)


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"

Edited by - D3mon on 27 March 2003 11:30:36
Go to Top of Page

ASPDude
Starting Member

United Kingdom
41 Posts

Posted - 27 March 2003 :  11:29:03  Show Profile  Visit ASPDude's Homepage
Recent as in IIS4?
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 27 March 2003 :  11:31:55  Show Profile  Visit D3mon's Homepage
Erm.. trying to remember when they added in the xtra server commands.... No, I think it would need to be ver.5 (always worth a try though eh!)


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page

ASPDude
Starting Member

United Kingdom
41 Posts

Posted - 27 March 2003 :  11:39:39  Show Profile  Visit ASPDude's Homepage
Didn't seem to impressed with that. Got the following:

Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'Execute'

/snitz34v3/portal_content.asp, line 134
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 27 March 2003 :  11:42:43  Show Profile  Visit D3mon's Homepage
Yeah, that'll be because those methods weren't introduced until version 5 then. If someone else can confirm it works, it might be worth the upgrade.


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"

Edited by - D3mon on 27 March 2003 11:43:44
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 27 March 2003 :  11:47:15  Show Profile  Visit D3mon's Homepage
Oooh... http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B301388


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 27 March 2003 :  14:55:00  Show Profile
server.execute and server.transfer were introduced in IIS5.0

Also, I doubt server.execute("my.php") would work. The documentation specifies that server.execute will execute an .asp file, not just any file. But you never know unless you try, I guess :)

======
Doug G
======
Computer history and help at www.dougscode.com
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 27 March 2003 :  15:06:43  Show Profile  Visit D3mon's Homepage
I'm pretty sure it should work as you can include an .htm(l) file which uses a different parser to ASP... So long as it only pushes HTML on to the outgoing stream it should be ok, but maybe that is where possible problems lie...


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"

Edited by - D3mon on 27 March 2003 15:08:30
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 27 March 2003 :  17:22:06  Show Profile
quote:
Originally posted by D3mon

I'm pretty sure it should work as you can include an .htm(l) file which uses a different parser to ASP... So long as it only pushes HTML on to the outgoing stream it should be ok, but maybe that is where possible problems lie...


No, include files in asp are not parsed separately. The code from all include files are merged with the code on the starting page, then the entire results are parsed as if the code from the start page and all included pages were really just one large page.

html include pages work because asp pages by default can have html in them.

======
Doug G
======
Computer history and help at www.dougscode.com
Go to Top of Page

ASPDude
Starting Member

United Kingdom
41 Posts

Posted - 28 March 2003 :  03:16:10  Show Profile  Visit ASPDude's Homepage
Guys, thatx for all your help with this. D3Mon, we have every intention of building a new W2K Server with IIS5 on it and then migrating (thanx for the link above) but thtis is a while away yet (still waiting to see what WS2003 has to offer...may go direct).

Dayve, I'd appreciate it if you could give me a link to or mail me your code that you used on your site.

Thanx again.
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.35 seconds. Powered By: Snitz Forums 2000 Version 3.4.07