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)
 Use PHP in ASP ?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 24 September 2008 :  03:50:23  Show Profile  Reply with Quote
Does anyone here know if it´s possible to use a piece of PHP code inside an ASP page ?

The reason I´m asking is that I would like to use a photoalbum script that reads a folder using PHP, a workaround the problem is to use iFrames, but ii would be much better if I could embed the PHP somehow into the ASP page.

Thanks<

AnonJr
Moderator

United States
5768 Posts

Posted - 24 September 2008 :  08:45:29  Show Profile  Visit AnonJr's Homepage  Reply with Quote
If you're talking about having both scripts on the same "page", I think not. However, you could probably use one to generate a CVS list or some XML or something to feed to the other.<
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 24 September 2008 :  10:03:01  Show Profile  Reply with Quote
Yeah, I´m talking about executing some PHP script inside an ASP page.<
Go to Top of Page

weeweeslap
Senior Member

USA
1077 Posts

Posted - 24 September 2008 :  12:17:59  Show Profile  Visit weeweeslap's Homepage  Send weeweeslap an AOL message  Send weeweeslap a Yahoo! Message  Reply with Quote
Thisis what I do to use php scripts in my asp scripts.
I have the php script do what I need it to do and spit out onto the php page what I want displayed.
I then open my asp page and where I want the php data to be displayed I do the following:

Dim objHttp
set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
objHttp.open "GET", "http://www.your_website.com/your_file.php", false
objHttp.Send
Response.Write objHTTP.ResponseText
Set objHTTP = Nothing


Just replace the url with the url of your php file and it will display whatever that php file spits out. I do that on http://www.coastercrazy.com/<

coaster crazy
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 24 September 2008 :  12:19:06  Show Profile  Visit Etymon's Homepage  Reply with Quote
Great tip, WW! Thanks! <
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 24 September 2008 :  16:25:40  Show Profile  Reply with Quote
When you use the http object to call your php page, keep in mind you're receiving only the results of the php page, your asp page doesn't have access to the actual php code, variables or objects, and the php code doesn't have access to your asp code, variables or objects. You're not embedding php code in an asp page with this method, but if it serves your purpose then it will work fine. I do something similar to embed a php calendar in an asp page.

Oh, and of course if the pages are on the same server it must have php installed into IIS.

<

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

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 25 September 2008 :  05:09:33  Show Profile  Reply with Quote
Hmmm, problem is how do I include that code into this ?

<script type="text/javascript">
var so = new SWFObject("../common/xmlGallery.swf", "gallery", "100%", "500", "6", "#FFFFFF");
so.addVariable("file_to_load", "../common/auto.php");
so.write("flashcontent");
</script><
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 26 September 2008 :  10:10:28  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message  Reply with Quote
That is client side javascript code which display a flash file.

What exactly are you trying to do ?<

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 29 September 2008 :  03:29:55  Show Profile  Reply with Quote
Get it to read this:

so.addVariable("file_to_load", "../common/auto.php");

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