Virtual Directory Support: off, need help with code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nevans
Forum Newbie
Posts: 3
Joined: Fri Jun 24, 2005 11:10 am

Virtual Directory Support: off, need help with code

Post by nevans »

Hi have this code below, that call the function virtual(). I was told by my host that Virtual Directory support is not enable on the shared server and they are not going to enable it. They said I should re-write the code to use another function. I have not idea how to do it. I am not a PHP programmer. This code is for a webcalendar. Can someone please help me.

Here is the code.

Code: Select all

<?
// Sample code for including CyberCalendar into your dynamic documents

$Calendar = "Calendar=$Calendar";
if ($DateID) { $DateID = "&DateID=$DateID"; }
if ($View) { $View = "&View=$View"; }
if ($searchtext) { $searchtext = urlencode($searchtext); $searchtext = "&searchtext=$searchtext"; }
if ($Category) { $Category = urlencode($Category); $Category = "&Category=$Category"; }
if ($Repeatid) { $Repeatid = "&Repeatid=$Repeatid"; }
if ($Next) { $Next = "&Next=$Next"; }

$query = "$Calendar$DateID$View$searchtext$Category$Repeatid$Next";

virtual("/calendar/index.pl?$query");
?>
d11wtq | Hey look what these

Code: Select all

tags do!   [/color]
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

Post by dethron »

Code: Select all

<? 
// Sample code for including CyberCalendar into your dynamic documents 

$Calendar = "Calendar=$Calendar"; 
if ($DateID) { $DateID = "&DateID=$DateID"; } 
if ($View) { $View = "&View=$View"; } 
if ($searchtext) { $searchtext = urlencode($searchtext); $searchtext = "&searchtext=$searchtext"; } 
if ($Category) { $Category = urlencode($Category); $Category = "&Category=$Category"; } 
if ($Repeatid) { $Repeatid = "&Repeatid=$Repeatid"; } 
if ($Next) { $Next = "&Next=$Next"; } 

$query = "$Calendar$DateID$View$searchtext$Category$Repeatid$Next"; 

include("/calendar/index.pl?$query"); 
?>
nevans
Forum Newbie
Posts: 3
Joined: Fri Jun 24, 2005 11:10 am

Post by nevans »

dethron wrote:

Code: Select all

<? 
// Sample code for including CyberCalendar into your dynamic documents 

$Calendar = "Calendar=$Calendar"; 
if ($DateID) { $DateID = "&DateID=$DateID"; } 
if ($View) { $View = "&View=$View"; } 
if ($searchtext) { $searchtext = urlencode($searchtext); $searchtext = "&searchtext=$searchtext"; } 
if ($Category) { $Category = urlencode($Category); $Category = "&Category=$Category"; } 
if ($Repeatid) { $Repeatid = "&Repeatid=$Repeatid"; } 
if ($Next) { $Next = "&Next=$Next"; } 

$query = "$Calendar$DateID$View$searchtext$Category$Repeatid$Next"; 

include("/calendar/index.pl?$query"); 
?>
The 'include' took away the error but I am not getting the page to work. The pages loads blank, like there is a problem with the index.pl
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

nevans wrote:
The 'include' took away the error but I am not getting the page to work. The pages loads blank, like there is a problem with the index.pl
PHP pages should be saved with ".php" extension.
nevans
Forum Newbie
Posts: 3
Joined: Fri Jun 24, 2005 11:10 am

Post by nevans »

neophyte wrote:
nevans wrote:
The 'include' took away the error but I am not getting the page to work. The pages loads blank, like there is a problem with the index.pl
PHP pages should be saved with ".php" extension.
The page that have the code above is called index.php so that's not the issue. The code - include ("/calendar/index.pl?query"); is not working correct , it was virtual ("/calendar/index.pl?query"); before but the server doesn't support the virtual php function that works with apache. I need to use another function that does the same thing like virtual() and works with CGI & .pl files which would parse through Apache.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Just inlclude('http://localhost/calendar/index.pl?$query')

The other way is too do this in run the perl script as a CLI but get the ouput....

Code: Select all

system('perl /path/to/index.pl '.$query);
Post Reply