hi, I just changed all my html files in my site to php files, then replaced the code on each page that was the menu with <?php include("menu.php"); ?> , and then created a separate menu file. It works fine in WAMP, but when I put it online and visited the site it says: "Parse error: syntax error, unexpected T_STRING in /home/jaatendi/public_html/shalimarhealthspa/index.php on line 1"
what the heck? thx in advance
biggest newb question ever (parse error)
Moderator: General Moderators
Re: biggest newb question ever (parse error)
1. Can you please post the code using the code tags?
2. Are you using short tags? ie <?
3. What program did you edit the file with?
2. Are you using short tags? ie <?
3. What program did you edit the file with?
Re: biggest newb question ever (parse error)
1.
here is the code for the index.php
here is the code for menu.php
3. I used dreamweaver
here is the code for the index.php
Code: Select all
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<!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" xml:lang="en" lang="en">
<head>
<link rel="stylesheet" href="watereddowntstyle.css" type="text/css" media="screen" />
<link rel="stylesheet" href="printstyle.css" type="text/css" media="print" />
<style type="text/css" media="screen"> @import"regularstyle.css"; </style>
<title>Shalimar Health Spa, Nelson British Columbia voted number one spa </title>
</head>
<!-- Start of StatCounter Code -->
<script type="text/javascript" language="javascript">
var sc_project=1951983;
var sc_invisible=1;
var sc_partition=17;
var sc_security="c2af92b4";
</script>
<script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><a href="http://www.statcounter.com/" target="_blank"><img src="http://c18.statcounter.com/counter.php?sc_project=1951983&java=0&security=c2af92b4&invisible=1" alt="web tracker" border="0"></a> </noscript>
<!-- End of StatCounter Code -->
<body>
<div id="wrapper">
<div id="banner">
<img src="images/spabanner.jpg" alt="spa banner" />
</div>
<?php include("menu.php"); ?>
<img src="images/intropic.jpg" alt="kootenay spa " />
</div> <!--wrapper-->
<div id="footer">
<p>2006 ShalimarHealthSpa All rights reserved. Website by <a href="http://www.gnosismedia.ca"> Gnosis Media</a> </p>
</div>
</body>
</html>
here is the code for menu.php
Code: Select all
<div id="menu">
<ul>
<li><a href="index.php">Home </a> </li>
<li><a href="contact.php">Contact </a></li>
<li><a href="treatments.php">Treatments </a> </li>
<li><a href="jaccuzi.php">Features </a> </li>
<li><a href="packages.php">Packages </a> </li>
<li><a href="reservations.php">Reservations </a> </li>
<li><a href="about.php">About </a> </li>
</ul>
</div>
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: biggest newb question ever (parse error)
Sitenote, Dreamweaver is notorious for adding hidden characters into the file. It's worth a try opening the file in notepad and overwriting the file.
Re: biggest newb question ever (parse error)
This is likely the culprit if short tags are enabled:
Code: Select all
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>