Jump to content

Specific page won't load


dootje84

Recommended Posts

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 content
if (!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 check
echo "<p>komtiedanhe</p>";

//the news
while ($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 connections
mysql_free_result($sql_result);
mysql_close($connect);
?>
Link to comment
https://forums.phpfreaks.com/topic/34493-specific-page-wont-load/
Share on other sites

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..

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.