Jump to content

Recommended Posts

I'm sorry if this is a simple mistake, I'm rather tired.  When designing a rather basic page, I'm simply getting nothing displayed. 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<link rel="stylesheet" href="style.css" />

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>KOAT</title>

</head>

 

<body>

<div class="header">

<img src="banner.gif" alt="logo" />

</div>

<div id="main">

<?php

{

if (isset("".$_GET['page'].".php")) 

     

              if ("".$_GET['page'] == 'index') 

              { 

          include('intro.php'); 

              } 

              else 

              { 

              include("".$_GET['page'] . ".php"); 

          } 

          else 

          { 

          include('intro.php'); 

          } 

    } 

    ?> ?>

</div>

<div id="footer">

<img src="footer.jpg" alt="logo" />

</div>

 

</body>

</html>

 

www.kreweofarcaneterrors.com/test

 

--Thanks

Link to comment
https://forums.phpfreaks.com/topic/46663-solved-error-in-display/
Share on other sites

If you're getting a blank page, it most likely means PHP is outputting an error, and display_errors is turned off on your server.

 

Before anything else, remove the extra closing php tag here:

 

          else 
          { 
          include('intro.php'); 
          } 
     } 
     ?>    ?>

Carr, here's a small example of how you can do this:

 

Asuming your urls will looke like this -> index.php?page=login...

 

<?php

  if (isset($GET['page'])) {

    if($_GET['page'] == 'login') { 

    include'login.php';
    }

    elseif($_GET['page'] == 'news') {
    include'news.php';
    } 

      else {
      include'members.php';
      }

  }

    else {
    include'main.php';
    }

?>

or using Caesar nice example you could use this code

 

Caesar check the isset (GET?)

 


<?php

if (isset($_GET['page']))
{
switch($_GET['page'])
{
	case 'login':
		include'login.php';
	break;
	case 'news':
		include'news.php';
	break;
	case 'members':
		include'members.php';
	break;
	default:
		include'main.php';
	break;	
}
}

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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