[SOLVED]Virtual($url)

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
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

[SOLVED]Virtual($url)

Post by infolock »

a buddy of mine gave me some code to work with that another buddy had originally wrote. Basically, I was just rewritting the app for him. He had like 16 seriously redundant files (i think there was 3 out of the 250 lines that was different in each one of them) and i put them all into a class.

there is a file (let's call it bob.php) that calls each one of these files via this line :

Code: Select all

virtual("mypage.php?time_formatted=$time_formatted");
the problem i have is that i have almost no clue as to what virtual does... well, besides what the online manual says (and that's not very much...)

here is all the code for what he's doing...

Code: Select all

<?php
if ($newDate_mon && $newDate_day && $newDate_year) {
$newDate = $newDate_year."-".$newDate_mon."-".$newDate_day;
$sqlDate = $newDate;
$time_formatted = $newDate_mon."/".$newDate_day."/".$newDate_year;
} else {
$sqlDate=date("Y-m-d");
$time_formatted=date("m/d/Y");
}

// display header
include("report-header.php");
?>
<div align="center" class="txt_big">
Reporting for <? echo $time_formatted; ?></div>
<?
virtual("mypage16.php?time_formatted=$time_formatted");
virtual("mypage1.php?time_formatted=$time_formatted");
virtual("mypage2.php?time_formatted=$time_formatted");
virtual("mypage15.php?time_formatted=$time_formatted");
virtual("mypage3.php?time_formatted=$time_formatted");
virtual("mypage4.php?time_formatted=$time_formatted");
virtual("mypage5.php?time_formatted=$time_formatted");
virtual("mypage6.php?time_formatted=$time_formatted");
virtual("mypage7.php?time_formatted=$time_formatted");
virtual("mypage8.php?time_formatted=$time_formatted");
virtual("mypage9.php?time_formatted=$time_formatted");
virtual("mypage10.php?time_formatted=$time_formatted");
virtual("mypage11.php?time_formatted=$time_formatted");
virtual("mypage12.php?time_formatted=$time_formatted");
virtual("mypage13.php?time_formatted=$time_formatted");
virtual("mypage14.php?time_formatted=$time_formatted");
?>
now, what happens is we choose a date from a dropdown menu on another page, and then this page generates the report based on that date with all these pages contained within the virtual call. it opens a popup window that has the data that is collected from all these pages.

now here is the catcher. this virtual call simply just calls the pages themselves, and all they do is post data... but there is nothing telling these files to post to the pop-up window and this file, as you can see, does not even call the popup window (except for the INCLUDE option). Nothing is even telling the popup window to open as a popup, or to even open for that matter, and yet... it does? that, however doesn't even matter because i can only assume the answer is somewhere in these other 500 files he has with this app lol...

so i guess i'm just completely lost at this one point in the application... if someone can shed some light on the virtual function and what relevance it plays in this type of script, it would be greatly appreciated as i could then fly through the rest... thanks


edit: n/m i found the solution...

http://www.modwest.com/help/kb5-212.html
Post Reply