Blank Page?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a functions page:
function connect()
   {
   include("includes/Vars.php");
mysql_connect($host, $user, $passwd) or die("Couldn't connect to database");
   mysql_select_db($db) or die("Couldn't select database");
}
function pagecontent()
   switch($_GET[page])
   {
       connect();
       case "about" :
           $sql = "SELECT * FROM page WHERE name='about'";
           $result = mysql_query($sql);
           $row = mysql_fetch_assoc($result);
           extract($row)
           echo <h2>{$title}</h2>;\n
           echo  $content ;
       break;
       case "contact" :
           $sql = "SELECT * FROM page WHERE name='contact'";
           $result = mysql_query($sql);
           $row = mysql_fetch_assoc($result);
           extract($row)
           echo <h2>{$title}</h2>;\n
           echo  $content ;
       break;
       default :
           $sql = "SELECT * FROM page WHERE name='home'";
           $result = mysql_query($sql,$cxn);
           $row = mysql_fetch_assoc($result);
           extract($row)
           echo <h2>{$title}</h2>;\n
           echo  $content ;
       break;
   }
   return;
}
and when i include that in another document and try and run the functions:

<div id="column_right">
   <div class="content">
   <?php pagecontent(); ?>
   </div>
</div>

The page appears completely blank. Im new to this and i am struggling to get anything to work.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux