PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: Posting Code in the Forums to learn how to do it too.
Hi,
I'm just started on PHP after a way too long time without using it. I have simply forgotten everything I ever learned. Can anyone tell me why the code
function top($pagetitle,$pagewidth,$dir) {
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" >
<link rel=stylesheet type="text/css" href="'.$dir.'style.css">
<title>'.$pagetitle.'</title>
</head>
<body><div align=center><table width='.$pagewidth.'><tr><td>';
return;
}
results in the error
Parse error: parse error, unexpected T_FUNCTION in file on line line
?
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: Posting Code in the Forums to learn how to do it too.
<?php
/* name: top
description: The top of all pages
written by: Bozack
created: 2008/12/15
modified: 2008/12/15
pagetitle: Title of the page
pagewidth: Width of the table containing the page
dir: Position from root */
// $pagetitle = '...' This is the default page title of the index page
global $pagewidth;
$pagewidth = '600px'
function top($pagetitle,$dir) {
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" >
<link rel=stylesheet type="text/css" href="'.$dir.'style.css">
<title>'.$pagetitle.'</title>
</head>
<body><div align=center><table width='.$pagewidth.'><tr><td>';
return;
}