Wrox Programmer Forums
|
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 7th, 2004, 03:13 PM
Registered User
 
Join Date: Oct 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Calling PHP from ASP

Greets.

Gotta library of PHP code for talking to various databases. Just inherited some ASP code that wants to talk to these databases. Don't want to re-write the library in ASP. What I'd like to do is write an intermediate layer that lets the ASP call the PHP functions and accept the data returned.

Anybody done anything like that?

Thanks.
 
Old October 7th, 2004, 04:11 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Is this a PHP piece a component (COM)?
 
Old October 7th, 2004, 06:35 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

I have had this situation myself, what platform you are planning to run it on?

I asume not windows and not IIS as you say, 'inherited ASP code' Chillisoft (Sun) will run ASP code thru Apache if thats any help to you. It has limitations and is a bit half ass if you ask me, lots of docs on Suns web site about it, we dont run it anymore.

I re-wrote all the code in the end, am iterested to hear the more experienced opinions on this one.

Wind is your friend
Matt
 
Old October 7th, 2004, 11:17 PM
Registered User
 
Join Date: Oct 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Let me clarify.

I inherited a situation with a bunch of ASP scripts on IIS 5, that want to talk to the same databases that my PHP objects already handle, on the same IIS server. I'd like to find an interface whereby the ASP can deal with the databases via the PHP code.

I imagine the interface would consist of both ASP and PHP scripts. Anybody done something like this?
 
Old November 13th, 2004, 09:25 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Im clear on what your trying to achieve. As I said, I re wrote the code myself. If there is such a tool out there, someone is making square pegs fit in round holes. Thinking of on-going development, portability etc - is it worth it.

Wind is your friend
Matt
 
Old November 23rd, 2004, 09:57 AM
Registered User
 
Join Date: Nov 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't think that's difficult. You can use querystring. For instance, the .asp pages will do their functionality as needed but when they want to use PHP libraries, they will get redirected to http://www.domain.com/somepage.php?name=<%=myname%>&age=<%=myage%>

The somepage.php will retrive the variables from querystring, pass those variables to the PHP functions and the result will be transfered back to the asp page in a similar way, but with PHP syntax. e.g, http://www.domain.com/somepage.asp&name=&name&age=$age

For the site visitor, he/she won't be able to see any .php page because a redirection will be done on entrance and exit to the PHP page.

I hope you have got what I want to say. Just use your imagination to make usability of PHP functions transparently. Tell me if it works or not.
 
Old November 23rd, 2004, 10:01 AM
Registered User
 
Join Date: Nov 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

A correction in my post. Sorry for that.

 
Quote:
quote:...and the result will be transfered back to the asp page in a similar way, but with PHP syntax. e.g, http://www.domain.com/somepage.asp&name=$name&age=$age
Quote:
.....
 
Old November 23rd, 2004, 05:42 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

arsalanj20

So requests are going from one server to another and back and forth...

Or are you suggesting running PHP pages and ASP pages on the same box? If so what type of box and what type of additional software?
Have you actually done this?

Intrigued


Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
Php Error when calling the cart() control function krifur BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8 11 February 23rd, 2013 02:28 AM
Calling Store Procedure in the PHP Code malay mehta MySQL 0 July 11th, 2007 09:06 AM
Calling Header Using PHP! Ganich PHP How-To 0 April 9th, 2007 11:04 AM
PHP calling JavaScript onUnload mlewitz PHP How-To 3 January 17th, 2006 10:24 AM
Calling PHP functions from ASP Smoobly Classic ASP Basics 4 January 10th, 2005 06:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.