Jump to content

home.php does not display


bluethundr

Recommended Posts

hey guys,

 

I wrote a simple script that is meant to display a home page that relies on a template file. For some reason this isn't working. I was hoping you could help me determine why home.php does not display.

 

Also I wanted to find out which books you felt were best to learn both PHP and MySQL separately. Ideally I would like to treat both topics as separate endeavors before I try to combine them. Which books helped you be the most successful at understanding both?

 

Here are the scripts

 

home.php

<?php
require "authentication.inc"; 
require_once "HTML/Template/ITX.php";

session_start();

// Connect to an authenticated session or relocate to logout.php
sessionAuthenticate();

$template = new HTML_Template_ITX("./templates");
$template->loadTemplatefile("home.tpl", true, true);

$template->setVariable("USERNAME", $_SESSION["loginUsername"]);
$template->parseCurrentBlock();
$template->show();
?>

 

home.tpl

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                      "http://www.w3.org/TR/html401/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <title>Home</title>
</head>
<body>
  <h1>Welcome to the application</h1>
  You are logged on as {USERNAME}
  <p><a href="password.php">Change Password</a>
  <p><a href="logout.php">Logout</a>
</body>
</html>

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/188385-homephp-does-not-display/
Share on other sites

Weird. When I pasted in the debugging code the page worked as it should have and forwarded the user to logout page as it should have and everything displayed. No errors were shown.

 

But I am having a new problem with this mini - application I am trying to write. Users cannot login. When they try to they are automatically sent to a page telling them they are not "authorized". But this is a database access problem and I think I will ask that question in the mysql forum.

 

Also I didn't seem to get any response on the "which books to read" question. Did I ask this question in the wrong forum? Is there another forum that I should have asked it in?

 

Thanks!

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.