ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The company I work in has a directory of all the websites of a certain business category.. it is written in php and connected to a mysql database that contains the data that is frequently updated....while another company's website has wide exposure..so the deal was to include our directory in their website....
They gave me a skeleton of their asp site with a note somewhere "your code goes here"...
I had already tailored a php page that would be included in their site....
Questions:
1- Can I include a php code within asp..."Note however,that the include file should call a php file on our server that will be executed on our server and the results will be displayed in the visitor's browser.
Example "abstract":
ASP CODE
<--#ASP include "http://www.php-page.com/directory.php" -->
ASP CODE
I know it sound weird...but I have to make it work someway....
Thanks for your reply...Iam a step nearer to my solve my problem ..now ...
Ive used this code:
<%
Set GetConnection = CreateObject("Microsoft.XMLHTTP")
GetConnection.Open "get", "http://www.thedaleel.com/index_test.php", False
GetConnection.Send
MyString = GetConnection.responseText
%>
Ive pasted this code into the asp page...and it showed in the status bar that www.thedaleel.com is loading...so that should have worked..but the problem is that the ouput was not displayed on the asp page..i.e. the images and text of the requested php page did not show up in the asp page...
Errmmm... I'm not an expert but, try ending your ASP (I don't know any ASP so... What I mean is like ?> thats for ending PHP but do that but for ASP) and then <?php include("yourphpfile"); ?> And then after start back your ASP. I was doing that for HTML I don't know if it's the same thing for ASP. As I say, I'm not an expert.
Ive pasted this code into the asp page.....but the problem is that the ouput was not displayed on the asp page
....well, he ASP code is just creating a string variable, so you would need to output the string in order to see it. (hehe... I didn't say the example code was perfect! ... adapt it as per requirements )
Something like: document.write(MyString) should do the trick.
ASP, PHP, JSP, ASPX, CFM, and so forth are all examples of "server side scripting".
When your web client requests a ".php" page from an Apache server, for example, the server must have been configured to:
a) recognize the .php file suffix the web client requested of it, and
b) Pass the page (your "source code") to the appropriate interpreter program (either a standalone php program or an Apache PHP plug-in).
The interpreter parses (executes) the page, and the results are passed back to the client.
So far, so good.
But how can the SAME interpreter handle DIFFERENT languages?
Believe it or not, the answer is "sometimes: it can!".
But in your case, I suspect you'll quickly reach a point where you need EITHER .asp OR .php code, where you will NOT be able to co-mingle the two languages on the same page.
Hopefully I'm being overly pessimistic, and you won't reach this juncture. But have you considered using frames?
....Hopefully I'm being overly pessimistic, and you won't reach this juncture. But have you considered using frames?
The idea here is to ensure the two pages run separately, but that the one includes the output of the other. The two languages don't have to intermix at all.
I've done it myself (when I was required to use an existing perl program inside a PHP system), so it can be done without doing anything special: Just make a http request, even to localhost, and the server will parse and execute the page before giving you the processed output. So it doesn't matter what language it was written in; all your calling program ever sees is the finished html, which can then be included in your page's final output however you see fit.
The only downside is that making all those http requests can be a bit heavy on server resources, but if you really do need to mix your languages, it is a good solution.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.