dootje84 Posted January 17, 2007 Share Posted January 17, 2007 Hi all!I'm new at this forum and not a die hard php-scripter, but most of the time I can manage myself. Right now I'm dazzled... I just can't figure out what the heck is wrong with my script.It's a simple script, which works for me most of the time, but now it refuses to load a specific page. Really weird, because it is included in the "safe"-array which includes pages to load... So maybe somebody can safe my ass with probably just a simple script...it's weird, because when a page should not load, an error appears, but now it doesn't, the script seems to give a hard exit.I tested the gNewsRead.php with just a div-block and it worked, but when I added the php-element "?" the script seems to do nothing but giving me the finger....who can help me?---<index.php>---- slechts betreffende php-stukje<?// page variable voor contentif (!isset($_GET["page"])) { $page = "gNewsWeb.php";}else { $page = $_GET["page"]; }//pages allowed to load$pages = array('gNewsAdd.php', 'gNewsAdd1.php', 'gNewsRead.php', 'gMediaAdd.php', 'gMediaAdd1.php', 'gMediaWeb.php', 'gTourAdd.php', 'gTourAdd1.php', 'gTourWeb.php', 'useroptions.php', 'logout.php');if( in_array($page, $pages) ){ include($page);} else { echo"<div class=\"block\">Unable to open that page, return and try again.</div>\n";}?>----<gNewsRead.php>----<?//so we still need to log in...require ("safe.php");//start query$sql = "SELECT * FROM gNews ORDER BY ID DESC";$sql_result = mysql_query($sql, $connect) or die("Couldnt exec Query");//pre checkecho "<p>komtiedanhe</p>";//the newswhile ($row = mysql_fetch_array($sql_result)){ echo "<div id='block'>" ." <h3>", $row['title'], "</h3>" ." <p>", $row['news_msg'], "</p>" ." <small>", $row['author'>, " @ ", $row['date'], "</small>" ."</div>";}//close connectionsmysql_free_result($sql_result);mysql_close($connect);?> Link to comment https://forums.phpfreaks.com/topic/34493-specific-page-wont-load/ Share on other sites More sharing options...
michaellunsford Posted January 17, 2007 Share Posted January 17, 2007 you're displaying [color=blue]gNewsRead.php[/color] but the variable says you're loading [color=blue]gNewsWeb.php[/color]. Maybe the problem is inside [color=blue]gNewsWeb.php[/color]? Link to comment https://forums.phpfreaks.com/topic/34493-specific-page-wont-load/#findComment-162536 Share on other sites More sharing options...
dootje84 Posted January 17, 2007 Author Share Posted January 17, 2007 hey michael!no, it was an typo in the paste, but even then the page should load when I give the command to open it in the menu.It's really weird. I think the error is somewhere in the gNewsRead.php, so I built it a few times from scratch (hence the gNewsWeb.php), controlling every step.. but as soon as the ?-tag appeared the script refused to do anything.Usually I find errors with the database, but now it's not even the query, it's the script without any doubt.... but what it is... beats me.. Link to comment https://forums.phpfreaks.com/topic/34493-specific-page-wont-load/#findComment-162674 Share on other sites More sharing options...
dootje84 Posted January 17, 2007 Author Share Posted January 17, 2007 can this topic be closed, problem is solved... Link to comment https://forums.phpfreaks.com/topic/34493-specific-page-wont-load/#findComment-163283 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.