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

Link to comment
Share on other sites

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.