Forum Moderators: coopster
<!--include virtual="/cgi-bin/relevant_script.php" -->. One of my scripts is more difficult to work with because it is a collection of links, each of which points to the same script with different arguments.
It is not acceptable to my boss to go to a URL like mysite.com/sub/script1.html (which just includes a script in cgi-bin) and have that link to mysite.com/cgi-bin/script2.php?arg1=blah . I want to have the script included in script1.html to link to another wrapper page that takes arguments (script2.html?arg1=blah) and have the included script take those arguments... Does anyone think this is possible or have a suggestion to do something like this?
Thanks, Ray
cgi-bin/include.php:
<?php echo "This is blah: ".$blah;?>
main.php:
<!DOCTYPE...
<html...
<body>
<p><?php
$blah = "Variable blah passed successfully to include";
include("cgi-bin/include.php");
?></p>
</body></html>
Do you have a php parser installed? Because the include you wrote doesn't look like php include, only cgi
Hope this post will help you to include php files normally
Best regards
Michal Cibor
The problem is that the pages that are to be viewed by the public are not in my cgi-bin directory. The server is set up (beyond my control) to only parse php in the cgi-bin directory. Therefore, to be able to display the output of any php scripts in the public directory, I have to use a cgi-style server-side include instead of just embedding the php into my file. If I could use php out of the cgi-bin directory, there wouldn't be any problem.
I have script1.html which includes /cgi-bin/script1.php and this script generates a list of links that go to script2.html. script2.html is a static html page that only contains
<!--#include virtual="/cgi-bin/script2.php" --> .