Click to See Complete Forum and Search --> : includes


jrthor2
01-12-2004, 01:08 PM
I have a site written in php. I have links to external sites that I want to use my "wrapper". If the external sites are not written in PHP, is this possible? If so, how? I know I have one external company using asp.

Thanks

pyro
01-12-2004, 02:27 PM
You'll probably want to check what they do support, as far as server-side languages go, then. Not sure exactly what you mean by "using your wrappers," though...

jrthor2
01-12-2004, 02:30 PM
using my "wrappers" meaning my navigation menu.

pyro
01-12-2004, 04:23 PM
SSI would be a popular alternative to PHP includes. See http://www.webdevfaqs.com/php.php#include

jrthor2
01-13-2004, 07:32 AM
Well, our entire corporate site iw written in php, using includes for the headers, nav bar and footers. Is it at all possible for external companies to use these header, nav and footer php pages if they don't have php on their site? ONe of our previous developers wrote a page that was suppossed to allow external sites to use our php pages using the following script:

<?php

include "_js_switch_logic.php";
$myfile="inc/layout_top.php";

$fcontents = file ("http://$SERVER_NAME/$myfile?$pass");

foreach($fcontents as $line) {
$line = str_replace("'", "\"", $line);
$line = str_replace("\n", "", $line);
print ("document.write('$line');\n");
}

?>

Here is the _js_switch_logic.php script included above:

<?php

switch($from) {
case "edgar":
$section="company";
$navfilename="nav_comp_investor.php";
break;
default:
$section="home";
$navfilename="nav_home.php";
break;
}

$pass="section=$section&navfilename=$navfilename";

?>

How could an external site use this?

pyro
01-13-2004, 08:50 AM
Yes, it should be, as when you include content from one server to another, it will include the output of the script, rather than the PHP itself.

jrthor2
01-13-2004, 09:03 AM
Hmm, if I include these pages on one of my own php pages, I don't get my nav bar. If I go directly to the _js_layout_top.php page in my browser, I get the document.write code for my nav bar. Any suggestions why when using a javascript include, it doesn't show my nav? Here is how I am trying to call it:

<script type="Javascript" src="http://www.server.com/inc/_js_layout_top.php"></script>