Hi all!
I have a page that has a MYSQL/PHP function to retrive databank data.
When I try add more extras in the form of a sidebar, the PHP throws a hissy fit, and comes up with this error:
[CODE]Parse error: syntax error, unexpected T_VARIABLE in /home/a9362702/public_html/comped.php on line 1
Here is comped.php (the exact same thing happens on downs.php – they are the same page other than to diffent databases and with different headers)
[CODE]<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”content-type” content=”text/html; charset=utf-8″ />
<title>Gameslinker – Links for all</title>
<meta name=”keywords” content=”” />
<meta name=”description” content=”” />
<link href=”page.css” rel=”stylesheet” type=”text/css” />
</head>
<body>
<div id=”page”>
<!– start content –>
<div id=”content”>
<div class=”post”>
<h1 class=”title”>Downloads Compedium</h1>
<b><i>With thanks for coding help from <a href=”http://www.charles-reace.com” target=”_blank”>NogDog</a> and ellisgl on the <a href=”http://www.webdeveloper.com” target=”_blank”>webdeveloper.com forums</a></i></b>
<br /><br />
<?php
$username=”a9362702_smods”;
$password=”***”;
$database=”a9362702_downs”;
mysql_connect(“mysql1.000webhost.com”,$username,$password);
mysql_select_db($database);
$query=”SELECT * FROM table02″;
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>
<table border=”0″ cellspacing=”2″ cellpadding=”2″>
<tr>
<th><font face=”Arial, Helvetica, sans-serif”>ID</font></th>
<th><font face=”Arial, Helvetica, sans-serif”>Download Name</font></th>
<th><font face=”Arial, Helvetica, sans-serif”>Download URL</font></th>
</tr>
<?php
$i=0;
while ($i < $num) {
$field1_name=mysql_result($result,$i,”dname”);
$field2_name=mysql_result($result,$i,”durl”);
$field3_name=mysql_result($result,$i,”did”);
?>
<tr>
<td><font face=”Arial, Helvetica, sans-serif”><a name=” <?php echo $field3_name; ?> “><?php echo $field3_name; ?> </a></font></td>
<td><font face=”Arial, Helvetica, sans-serif”><?php echo $field1_name; ?></font></td>
<td><font face=”Arial, Helvetica, sans-serif”><a href=” <?php echo $field2_name; ?> “><?php echo $field2_name; ?> </a></font></td>
</tr>
<?php
$i++;
}
echo “</table>”;
?>
</div>
</div>
<!– end content –>
<!– start sidebar –>
<div id=”sidebar”><br />
<h2>Report Abuse</h2>
Please report all spam to the <a href=”mailto:[email protected]”>admin</a>, or a <br /><a href=”mailto:[email protected]”>super</a> <a href=”mailto:[email protected]”>moderator</a>
<h2>Add a Game</h2>
Anyone can now add a game. Click more in the title bar. Beware that spammers will be blocked.
</div>
<!– end sidebar –>
<div style=”clear: both;”> </div>
</div>
</body>
</html>
comped.php (and all other pages inside my website) are inside index.html:
[CODE]<body>
<!– start header –>
<div id=”header”>
<div id=”logo”>
<h1><a href=”index.html”>GamesLinker</a></h1>
<h2>more than just games…</h2>
</div>
<div id=”menu”>
<ul>
<li><a href=”index.html”>home</a></li>
<li><a href=”comped.php” target=”page”>Flash Games</a></li>
<li><a href=”downs.php” target=”page”>Downloads</a></li>
<li><a href=”chat.html” target=”page”>Chat</a></li>
<li><a href=”admin.php” target=”page”>More</a></li>
</ul>
</div>
</div>
<!– end header –>
<!– start page –>
<iframe src=”home.html” width=”100%” height=”660″ name=”page” border=”0″></iframe>
<!– end page –>
<!– start footer –>
<div id=”footer”>
<p id=”legal”>(c) 2008 YourSite. Design by <a href=”http://www.freecsstemplates.org/”>Free CSS Templates</a>.</p>
</div>
<!– end footer –>
</body>
Index.html is controlled by this CSS:
[CODE]<style>
/*
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
*/
body {
margin: 0;
padding: 0;
background: #666159 url(images/img01.jpg) repeat-x;
font-family: “Trebuchet MS”, Arial, Helvetica, sans-serif;
font-size: 13px;
color: #D4D4D4;
}
iframe{
border: none; //both have this in them, but it didnot copy into the other one
}
h1, h2, h3 {
margin: 0;
text-transform: lowercase;
font-weight: normal;
color: #FFFFFF;
}
h1 {
letter-spacing: -1px;
font-size: 32px;
}
h2 {
font-size: 23px;
}
p, ul, ol {
margin: 0 0 2em 0;
text-align: justify;
line-height: 26px;
font-size: 11px;
}
a:link {
color: #C1D11C;
}
a:hover, a:active {
text-decoration: none;
color: #C1D11C;
}
a:visited {
color: #C1D11C;
}
img {
border: none;
}
img.left {
float: left;
margin-right: 15px;
}
img.right {
float: right;
margin-left: 15px;
}
/* Header */
#header {
width: 850px;
height: 82px;
margin: 0 auto 40px auto;
}
#logo {
float: left;
}
#logo h1 {
font-size: 38px;
color: #FFFFFF;
}
#logo h1 sup {
vertical-align: text-top;
font-size: 24px;
}
#logo h1 a {
color: #FFFFFF;
}
#logo h2 {
margin-top: -10px;
font-size: 12px;
color: #A0A0A0;
}
#logo a {
text-decoration: none;
}
/* Menu */
#menu {
float: right;
}
#menu ul {
margin: 0;
padding: 15px 0 0 0;
list-style: none;
}
#menu li {
display: inline;
}
#menu a {
display: block;
float: left;
background: #F5F5F5;
margin-left: 5px;
padding: 7px 20px;
text-decoration: none;
font-size: 13px;
color: #000000;
}
#menu a:hover {
border-top: 5px solid #C1D11C;
border-bottom: 3px solid #C1D11C;
text-decoration: none;
}
#menu .active a {
border-top: 5px solid #C1D11C;
border-bottom: 3px solid #C1D11C;
}
/* Footer */
#footer {
height: 100px;
min-height: 74px;
padding: 10px 0 0 0;
background: #666159 url(images/img02.jpg) repeat-x left top;
}
html>body #footer {
height: auto;
}
#legal {
clear: both;
padding-top: 30px;
text-align: center;
color: #A0A0A0;
}
#legal a {
color: #A0A0A0;
}
</style>
but all the others by this Css (the only css in an exernal css file):
[CODE]/*
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
*/
body {
margin: 0;
padding: 0;
background: #666159;
font-family: “Trebuchet MS”, Arial, Helvetica, sans-serif;
font-size: 13px;
color: #D4D4D4;
}
h1, h2, h3 {
margin: 0;
text-transform: lowercase;
font-weight: normal;
color: #FFFFFF;
}
h1 {
letter-spacing: -1px;
font-size: 32px;
}
h2 {
font-size: 23px;
}
p, ul, ol {
margin: 0 0 2em 0;
text-align: justify;
line-height: 26px;
font-size: 13px;
}
.imp {
color: red;
}
a:link {
color: #C1D11C;
}
a:hover, a:active {
text-decoration: none;
color: #C1D11C;
}
a:visited {
color: #C1D11C;
}
img {
border: none;
}
img.left {
float: left;
margin-right: 15px;
}
img.right {
float: right;
margin-left: 15px;
}
/* Form */
form {
margin: 0;
padding: 0;
}
fieldset {
margin: 0;
padding: 0;
border: none;
}
legend {
display: none;
}
input, textarea, select {
font-family: “Trebuchet MS”, Arial, Helvetica, sans-serif;
font-size: 13px;
color: #333333;
}
/* Page */
#page {
width: 850px;
margin: 0 auto;
}
/* Content */
#content {
float: left;
width: 600px;
}
/* Post */
.post {
}
.post .title {
margin-bottom: 20px;
margin-top: 20px;
padding: 0 0 7px 18px;
background: url(images/img03.gif) no-repeat left 50%;
border-bottom: 1px solid #86910F;
}
.post .entry {
}
.post .meta {
border: 1px solid #86910F;
padding: 15px 10px 30px 10px;
}
.post .meta p {
margin: 0;
line-height: normal;
color: #999999;
}
.post .meta .byline {
float: left;
}
.post .meta .links {
float: right;
}
.post .meta .more {
padding: 0 20px 0 18px;
background: url(images/img06.gif) no-repeat left center;
}
.post .meta .comments {
padding-left: 22px;
background: url(images/img07.gif) no-repeat left center;
}
.post .meta b {
display: none;
}
/* Sidebar */
#sidebar {
float: right;
width: 225px;
}
#sidebar ul {
margin: 0;
padding: 0;
list-style: none;
}
#sidebar li {
margin-bottom: 40px;
}
#sidebar li ul {
}
#sidebar li li {
margin: 0;
padding-left: 12px;
}
#sidebar h2 {
margin-bottom: 10px;
padding-left: 15px;
background: url(images/img04.gif) no-repeat left 50%;
border-bottom: 1px solid #86910F;
font-size: 16px;
}
/* Search */
#search {
}
#search h2 {
margin-bottom: 20px;
}
#s {
width: 110px;
margin-right: 5px;
padding: 2px;
border: 1px solid #F0F0F0;
}
#x {
padding: 4px 4px;
background: #C1D11C;
border: none;
text-transform: uppercase;
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #FFFFFF;
}
/* Boxes */
.box1 {
padding: 20px;
background: url(images/img05.gif) no-repeat;
}
.box2 {
color: #BABABA;
}
.box2 h2 {
margin-bottom: 15px;
background: url(images/img10.gif) repeat-x left bottom;
font-size: 16px;
color: #FFFFFF;
}
.box2 ul {
margin: 0;
padding: 0;
list-style: none;
}
.box2 a:link, .box2 a:hover, .box2 a:active, .box2 a:visited {
color: #EDEDED;
}
You can see the barebones and the error online here
[URL=”http://www.thelinker.net63.net/index.html”]http://www.thelinker.net63.net/index.html