Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMartina Carrington
15,754 PointsParse error: syntax error, unexpected '4' (T_LNUMBER), expecting ',' or ';' in C:\xampp\htdocs\index.php on line 3
i put all the folders in the htdoc and i received this syntax error message
6 Answers
rtholen
Courses Plus Student 11,859 Pointsindex.php has an error in it. But we need to see the contents before we can help you. Please post the contents of index.php using the rules in the Markdown Cheatsheet link near bottom of this page.
rtholen
Courses Plus Student 11,859 PointsI have not seen your video so I am only going on what I see here, which may be out of context. I don't believe you should change the file back to index.html. The PHP processor running on the server reads/parses your index.php file and converts it to an html file. Then sends it to the client's browser. If the contents of your index.php are as shown above, then you still need to add the normal html, head, and body tags to index.php.They are missing. For example, all your divs above should be wrapped inside body tags, like they would be if it was a normal HTML file. Try adding those missing tags.
Ted Sumner
Courses Plus Student 17,967 PointsPlease copy and paste your entire index.php code here. What you quoted above would not throw that error I don't think.
You can change a normal html page and change it to .php and have no errors.
Martina Carrington
15,754 Pointsindex.php
<?php include('inc/header.php'); ?>
<div class="section banner">
<div class="wrapper">
<img class="hero" src="img/mike-the-frog.png" alt="Mike the Frog says:">
<div class="button">
<a href="#">
<h2>Hey, I’m Mike!</h2>
<p>Check Out My Shirts</p>
</a>
</div>
</div>
</div>
<div class="section shirts latest">
<div class="wrapper">
<h2>Mike’s Latest Shirts</h2>
<ul class="products">
<li><a href="#">
<img src="img/shirts/shirt-108.jpg">
<p>View Details</p>
</a>
</li><li>
<a href="#">
<img src="img/shirts/shirt-107.jpg">
<p>View Details</p>
</a>
</li><li>
<a href="#">
<img src="img/shirts/shirt-106.jpg">
<p>View Details</p>
</a>
</li><li>
<a href="#">
<img src="img/shirts/shirt-105.jpg">
<p>View Details</p>
</a>
</li>
</ul>
</div>
</div>
<?php include('inc/footer.php');?>
edited to format code quote. Ted Sumner
rtholen
Courses Plus Student 11,859 PointsIs this the full contents of your index.php? I believe this file is meant to be parsed by a server into a valid HTML doc. As is, I don't see the needed html, head, and body tags in index.php needed for valid HTML output.
Martina Carrington
15,754 Points@Rtholen , oh ok ! you think i should change it back to index. html
Martina Carrington
15,754 PointsI re-watch php course called including the header to make sure everything is link but i still the same problem . i hope don't sound like a nag lol
Ted Sumner
Courses Plus Student 17,967 PointsYour error problem is related to the problem this post you made: https://teamtreehouse.com/community/how-do-use-the-localhost. I have posted the solution there also. You need to change line of your header.html to this:
<?php
/// the change is below this comment:
<title><?php echo "Shirts 4 Mike";?></title>
Martina Carrington
15,754 PointsMartina Carrington
15,754 Pointsrtholen , here is my index.php code <?php include('inc/header.php'); ?>