divadiva Posted January 15, 2009 Share Posted January 15, 2009 I have this page working fine.Thing is when I enter http://www.agsemiconductor.com/SugarCRM/index.php?entryPoint=removeme&identifier={MESSAGE_ID} I get the webpage.(entry point defined as removeme) But when I enter http://www.agsemiconductor.com/SugarCRM/index.php?entryPoint=123&identifier={MESSAGE_ID}(entry point defined as 123) I see a blank page.Whereas it should die I should get You dont have right to view the page. <?php error_reporting(0); $fileDir = "http://"; // Write an appropriate path name. $fileName = "index.php"; //Provide a valid file name. $fileLink ='?entryPoint='.$_GET["entryPoint"].'&identifier='.$_GET["identifier"];//Add the additional links $fileString = $fileDir.'/'.$fileName.$fileLink;//Append all the links if($fileLink = '?entryPoint='.$_GET["entryPoint"].'&identifier='.$_GET["identifier"] && in_array($_GET["entryPoint"], array('removeme','campaign_tracker2','campaign_tracker'))) { if(!$fdl=@fopen($fileString ,'r')) { die("You dont have right to view the page!");//For somereason this is not working ??? } else { $contentType = 'text/html'; header("Cache-Control: ");// leave blank to avoid IE errors header("Pragma: "); // leave blank to avoid IE errors header("Content-type: $contentType"); fpassthru($fdl); } } ?> Link to comment https://forums.phpfreaks.com/topic/140979-solved-help-with-if-else-in-side-the-code/ Share on other sites More sharing options...
trq Posted January 15, 2009 Share Posted January 15, 2009 Set error reporting to E_ALL and remove the @ supresor from the call to fopen(). Link to comment https://forums.phpfreaks.com/topic/140979-solved-help-with-if-else-in-side-the-code/#findComment-737857 Share on other sites More sharing options...
divadiva Posted January 15, 2009 Author Share Posted January 15, 2009 Thanks fo replying but Die is not working right.Rest everything works. error_reporting(0); $fileDir = "http://67.100.111.140/SugarCRM"; // Write an appropriate path name. $fileName = "index.php"; //Provide a valid file name. $fileLink ='?entryPoint='.$_GET["entryPoint"].'&identifier='.$_GET["identifier"];//Add the additional links $fileString = $fileDir.'/'.$fileName.$fileLink;//Append all the links if($fileLink = '?entryPoint='.$_GET["entryPoint"].'&identifier='.$_GET["identifier"] && in_array($_GET["entryPoint"], array('removeme','campaign_tracker2','campaign_tracker'))) { if($fdl=@fopen($fileString ,'r')) { $contentType = 'text/html'; header("Cache-Control: ");// leave blank to avoid IE errors header("Pragma: "); // leave blank to avoid IE errors header("Content-type: $contentType"); fpassthru($fdl); } else { die("You dont have right to view the page!");/// Problem is DIE doesnt work I see a blank page and not the die message } } ?> Link to comment https://forums.phpfreaks.com/topic/140979-solved-help-with-if-else-in-side-the-code/#findComment-737866 Share on other sites More sharing options...
trq Posted January 15, 2009 Share Posted January 15, 2009 error reporting is still turned off and the @ supresor is still in place. Fix them and we might be able to see whats going on. Link to comment https://forums.phpfreaks.com/topic/140979-solved-help-with-if-else-in-side-the-code/#findComment-737867 Share on other sites More sharing options...
divadiva Posted January 15, 2009 Author Share Posted January 15, 2009 Thankyou once again for replying. I get a blank page.I thave taken out error reporting . Link to comment https://forums.phpfreaks.com/topic/140979-solved-help-with-if-else-in-side-the-code/#findComment-737868 Share on other sites More sharing options...
divadiva Posted January 15, 2009 Author Share Posted January 15, 2009 There was no makor error.I was not closing the IF statement.Thanks all for help though. error_reporting(0); $fileDir = "xyz"; // Write an appropriate path name. $fileName = "index.php"; //Provide a valid file name. $fileLink ='?entryPoint='.$_GET["entryPoint"].'&identifier='.$_GET["identifier"];//Add the additional links $fileString = $fileDir.'/'.$fileName.$fileLink;//Append all the links if($fileLink = '?entryPoint='.$_GET["entryPoint"].'&identifier='.$_GET["identifier"] && in_array($_GET["entryPoint"], array('removeme','campaign_tracker2','campaign_tracker'))) { if($fdl=@fopen($fileString ,'r')) { $contentType = 'text/html'; header("Cache-Control: ");// leave blank to avoid IE errors header("Pragma: "); // leave blank to avoid IE errors header("Content-type: $contentType"); fpassthru($fdl); } } else { die("You dont have right to view the page!");/// Problem is DIE doesnt work I see a blank page and not the die message } ?> Link to comment https://forums.phpfreaks.com/topic/140979-solved-help-with-if-else-in-side-the-code/#findComment-737891 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.