I am getting a HTTP error 500 error whilst trying to display my web page. The hosting company I am using is http://www.bytehost.com and they are running PHP 5.2.9.
I am using this free host for a college project, but I do have my own paid hosting. The thing is, it displays correctly on my own hosting, which is also on PHP 5.
The page I am trying to display is using the Smarty templating engine. The error seems to be with the display() method of the Smarty() class, because when I commented it out, the page displayed but with PHP errors.
Here is my index.php code:
The phpinfo() page for my free hosting is located here, if it helps: http://stiefel.byethost5.com/potatoes.phpPHP Code:<?php
// Require the Smarty template file
require_once('inc/smarty/Smarty.class.php');
// Initialize new template
$template = new Smarty();
// Configure Smarty templtae variables
$template->template_dir = 'inc/smarty/templates';
$template->compile_dir = 'inc/smarty/templates_c';
$template->cache_dir = 'inc/smarty/cache';
$template->config_dir = 'inc/smarty/configs';
// Create page variables
$page_title = 'Welcome'; // Page title
$site_url = 'http://stiefel.byethost5.com'; // Web site base URL
$site_css = 'stiefel_default.css'; // CSS file to use
$employee_login = '<a href="#">Employee Login</a>'; // Employee login link
// Navigation bar
$navlist = '<ul id="navlist">
<li><a href="#">Home</a></li>
<li><a href="#">Products</a>
<ul class="submenu">
<li><a href="#">Search</a></li>
<li><a href="#">View all products</a></li>
</ul>
</li>
<li><a href="#">Blog</a></li>
<li><a href="#">Contact Us</a></li>
</ul>';
// Customer login
$customer_login = '<form id="form1" method="post" action="">
<p>Customer Login:</p>
<p>
<label>Username:
<input type="text" name="username" id="username" />
</label>
</p>
<p>
<label>Password:
<input type="text" name="password" id="password" />
</label>
</p>
<p>
<input type="submit" name="login" id="login" value="Login" />
<br />
<a href="#">Register</a> | <a href="#">Forgot password</a>
</p>
</form>';
// Page content
$page_content = '<p>Welcome to Stiefel Laboratories home page. Give us all your money and we will supply you with drugs.</p>';
// Assign template variables
$template->assign( 'page_title', $page_title );
$template->assign( 'site_url', $site_url );
$template->assign( 'site_css', $site_css );
$template->assign( 'employee_login', $employee_login );
$template->assign( 'navlist', $navlist );
$template->assign( 'customer_login', $customer_login );
$template->assign( 'page_content', $page_content );
// Display template
$template->display('stiefel.tpl');
?>
Thanks for any help!







Bookmarks