Closed Thread Icon

Preserved Topic: perl and php on the same page? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12088" title="Pages that link to Preserved Topic: perl and php on the same page? (Page 1 of 1)" rel="nofollow" >Preserved Topic: perl and php on the same page? <span class="small">(Page 1 of 1)</span>\

 
jstuartj
Bipolar (III) Inmate

From: Mpls, MN
Insane since: Dec 2000

posted posted 03-06-2002 00:52

I finally managed to get my webserver running with perl and php, and .htaccess. I was testing things out and I cam across a question. Perhaps someone could assist me.

If I use .html or .htm I don't get perl or php.

If I use .shtml I can see the perl line

If I use index.php I see the PHP line.

So far it is working as I expected.

Is there a way to use both php and perl in the same document? I don't know if there any real reason but I am just wondering. What if I want to call a perl cgi and use php something else.

Here is my html:

<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<P>Welcome to J. Stuart J. Productions.</P>
<P> This is a test of PERL, The Current Time is:

<!--#exec cgi="/cgi-bin/clock.cgi" -->

</P>

<?php
Print ("This code is created via PHP");
?>

<P></P></BODY>
</HTML>


Here is my .htaccess file, I want limit ssi on a folder by folder basics. I would like to limit php as well but haven't worked that out yet.

AuthType Basic
AuthName "Enter user name and password."
AuthUserFile C:/ApacheGroup/Apache/.htpasswd
Require user somebody

Options Indexes FollowSymLinks Includes

AddHandler server-parsed .shtml

AddType text/html .shtml

DirectoryIndex index.html index.htm index.shtml index.php

Any advice would be helpful.

jstuartj

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 03-06-2002 08:13

You can call CGI scripts from PHP pages by using virtual() function, which is equivalent to <!--#include virtual...--> in SSI...

And to solve your second problem, put this in your .htaccess file:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps


jstuartj
Bipolar (III) Inmate

From: Mpls, MN
Insane since: Dec 2000

posted posted 03-06-2002 16:03

Thanks, Max. Now on to installing MySQL. Wish me luck.


jstuartj

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 03-06-2002 21:56

I had to do something similar with a PHP shopping service when I integrated our payment service. I ended up using an exec command to call a perl script which returned data to my php.

Note: this doesn't really do both perl and php on one page but it let's you call external perl scripts.
I do wonder though if you can use both mod_perl with PHP as long as they both use different delimeters for the scripting space. hmmm.. interesting.



:[ Computers let you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila. ]:

« BackwardsOnwards »

Show Forum Drop Down Menu