trouble retrieving a function

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
pleigh
Forum Contributor
Posts: 445
Joined: Wed Jan 19, 2005 4:26 am

trouble retrieving a function

Post by pleigh »

hi, im having trouble with functions. i have a code for switch statement:

Code: Select all

case 16:
	$reporttitle = "Log File Report";	
	$reportfile = "rpt_dt_log_file.php";
	if (empty($sort))
		{$sort = "all";}
	break;
when a link is clicked, case 16 will be generated and it will include that php page on this page.the php code for that is:

Code: Select all

<?php													
     include ($reportfile) ;
?>
when i tried to click on the link, it will load smoothly on my computer, retrieval of data from the database is fine. but when i tried to upload this to our development server, and click on the link that will generate the $reportfile, nothing is retrieved. i tried to check if the value of $reportfile is null so i did this:

Code: Select all

if ($reportfile == null) {
	echo "function returns null";
}
i uploaded the file to the server, and now, i can see the the echo string "function returns null". i was just wondering why this is happening. i have the same code on my computer and it is working fine, but on the server, it is not working. by the way, we have a linux os for the development server. please help me figure this out. thank you in advance.

:)
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Probably a register_globals problem. You should turn OFF register_globals on all of your systems. Then you need to use $_GET['reportfile'] or $_POST['reportfile'] instead of $reportfile.
(#10850)
User avatar
pleigh
Forum Contributor
Posts: 445
Joined: Wed Jan 19, 2005 4:26 am

Post by pleigh »

arborint wrote:Probably a register_globals problem. You should turn OFF register_globals on all of your systems. Then you need to use $_GET['reportfile'] or $_POST['reportfile'] instead of $reportfile.
hi, thank you for the reply. im not sure about turning off the register_globals. should i edit the php.ini? because if i have to modify that, im afraid i cant because its on another location and i dont have privilege to do that. can i turn that off through script?and how? thanks again.. :)
Post Reply