Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8026 Posts in 1851 Topics- by 2099 Members - Latest Member: roi
Pages: [1]   Go Down
Print
Author Topic: Serverside Includes for PHP  (Read 230 times)
0 Members and 1 Guest are viewing this topic.
rjwelte
New Member
*

Karma: 0
Offline Offline

Posts: 0

web dev


« on: June 23, 2005, 06:11:00 PM »

I'm using this include:
<?php require_once('cgi-bin/calendar.cgi'); ?>
I can see the calendar when I call it directly. ex: http://208.187.190.34/~octinc/cgi-bin/calendar.cgi   but when I include it inside a plage called calendar.php http://208.187.190.34/~octinc/calendar.php  it gives a print out of the code in the calendar.cgi page and refuses to display it.

If i include more paramters like:

<?php require_once('cgi-bin/calendar.cgi?calendar=default&template=ssi.html&duration=31d' ?>

it choaks and displays nothing!!

HELP!

[This message has been edited by rjwelte (edited June 23, 2005).]

[This message has been edited by rjwelte (edited June 23, 2005).]

[This message has been edited by rjwelte (edited June 23, 2005).]

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 221

Please don't PM me. Post in the open forum.


WWW
« Reply #1 on: June 23, 2005, 09:52:00 PM »

** when I include it inside a plage called calendar.php htp://208.187.190.34/~octinc/calendar.php it gives a print out of the code in the calendar.cgi page **

Than it is not being executed like it has to be, the files text is just being included.

Try using file() with the full URI (including the htpp://...) like you would for any other web page whose source you wanted to capture with PHP. If you're on an Apache server, depending on how PHP is configured, you may also be able to use virtual() (check with your host's support) and just a path.

** require_once(... it choaks and displays nothing!! **

You can only require PHP code into a PHP script. That is not the right function to use for anything else.

Dan O.


[This message has been edited by DanO (edited June 23, 2005).]

Logged
rjwelte
New Member
*

Karma: 0
Offline Offline

Posts: 0

web dev


« Reply #2 on: June 24, 2005, 10:35:00 AM »

Virtual('path to file') worked. Thanks

john welte

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 221

Please don't PM me. Post in the open forum.


WWW
« Reply #3 on: June 24, 2005, 11:35:00 AM »

Glad to hear it.

Dan O.

------------------

Logged
Pages: [1]   Go Up
Print
Jump to: