Need Perl and PHP to work together on a single page!

 
Post new topic   Reply to topic    Aprelium Forum Index -> Perl
View previous topic :: View next topic  
Author Message
orion846
-


Joined: 29 Apr 2003
Posts: 4

PostPosted: Fri May 16, 2003 8:15 pm    Post subject: Need Perl and PHP to work together on a single page! Reply with quote

Hi I've got a number of PHP scripts running on my pages, and recently have the need for perl scripts also.

Generally, the situation is my pages are all .php, for example, index.php, because I have a number of scripts running on them. One such reason for the .php is that i have menus on either side of the screen, which I put there with include statements for the php script which gives the menu, so that I don't have to change the menu on several pages everytime I change it. This works great with no problems.

My problem now is I have a Perl script for a "Picture of the Day" function, which I want to put INTO the included php script, which is included into my index.php

If you're confused, go to http://www.orion846.com you can see what I have thus far, the two side menus are included txt or php files. Where it shows picture of the day and nothing underneath is where the included .pl should be showing.

The .pl will show up fine if I rename the index to .shtml from .php, however then my php scripts do not work. Also I tried have .shtml as an extension for php scripts instead of .php, which then showed the php scripts normally, but did not show the .pl still, almost like the .pl refuses to work so long as .php is working also.

PLEASE HELP! This is a really good potd script, the only good free one i've find, and I really don't want to just bag the idea of having a potd.
Back to top View user's profile Send private message
vbgunz
-


Joined: 02 Feb 2003
Posts: 615
Location: Florida

PostPosted: Sat May 17, 2003 12:14 am    Post subject: Reply with quote

Cross posting (same question in different threads) is not a wise idea. If you have to, make a link to it instead... One thread might get the answer while the other does not... It makes it harder for those who search for answers.

I am pasting this for others...

php and perl on the same page won't work. Best you can do to get php and perl to look as if their on the same page is maybe use the iframe tag within your php pages to display perl content... Give the iframe tag a try, you might like it. Good luck :)
_________________
Victor B. Gonzalez
http://aeonserv.com
Back to top View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
vbgunz
-


Joined: 02 Feb 2003
Posts: 615
Location: Florida

PostPosted: Sat May 17, 2003 3:37 am    Post subject: Reply with quote

Insert the following into your webpage and you'll understand really quickly what an iframe tag is and its benefits.

Code:
<IFRAME src="http://www.vbgunz.com" width=400 height=400></IFRAME>


You can add features such as scrolling="yes" scrollbars="yes" etc, do a search for iframe and you can learn pretty quickly the extra features not mentioned here...

With everything on the web their is a downside to this. Due to cross scripting attacks you're somewhat limited to logging into anything within an iframe though some scripts might let you... You'll really have to know your HTML in order to get some things to work...

Experiment and play around with it, its the best teacher. Good luck :)
_________________
Victor B. Gonzalez
http://aeonserv.com
Back to top View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Moxxnixx
-


Joined: 21 Jun 2003
Posts: 1226
Location: Florida

PostPosted: Tue Aug 05, 2003 2:45 pm    Post subject: One slution... Reply with quote

If you want the results (like you have a clock.pl script and you want to show it's output, namely current time), then use:
readfile("http://your.server.name/folder/clock.pl");

This way, the php engine asks for the file from your internet server, not the file system.
Back to top View user's profile Send private message Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Tue Aug 05, 2003 4:35 pm    Post subject: Re: Need Perl and PHP to work together on a single page! Reply with quote

orion846,

You can also create an SSI page that will include both the PHP script and the Perl script.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Kent
-


Joined: 12 Jan 2003
Posts: 137

PostPosted: Tue Aug 05, 2003 7:00 pm    Post subject: ? Reply with quote

it's possible for him to use the
Code:
<?include('url http://your.com/script-location/script.cgi');?>
to do what he wants... i've done this for embedding php and cgi on one page, & it worked. Give it a shot dude.

( doing this requires moderate PHP knowledge, some cgi script code may need tweaking on certain scripts... I.E
Code:
<form method="POST">
on a cgi script being ebedded on a php page is not going to call right you will need to tweak things like that... all minor stuff )
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Perl All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group