Use PHP in ASP ? - نوشته شده در (1874 Views)
Free ASP Hosts Moderator
wii
مطلب: 2632
2632
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<
 پیش‌فرض مرتب‌سازی برای تاریخ DESC به معنی جدیدترین است  
 تعداد در صفحه 
نوشته شده در
Forum Moderator
AnonJr
مطلب: 5768
5768
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.<
نوشته شده در
Free ASP Hosts Moderator
wii
مطلب: 2632
2632
Yeah, I´m talking about executing some PHP script inside an ASP page.<
نوشته شده در
Senior Member
weeweeslap
مطلب: 1077
1077
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:
Code:

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/<
نوشته شده در
Advanced Member
Etymon
مطلب: 2396
2396
Great tip, WW! Thanks! wink<
نوشته شده در
Support Moderator
Doug G
مطلب: 6493
6493
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
نوشته شده در
Free ASP Hosts Moderator
wii
مطلب: 2632
2632
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><
نوشته شده در
Support Moderator
Podge
مطلب: 3776
3776
That is client side javascript code which display a flash file.
What exactly are you trying to do ?<
نوشته شده در
Free ASP Hosts Moderator
wii
مطلب: 2632
2632
Get it to read this:

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

<
 
شما باید یک متن وارد کنید