View previous topic :: View next topic |
Author |
Message |
shinobi168
Joined: 15 Mar 2004 Posts: 9 Location: Indiana
|
Posted: Mon Mar 15, 2004 9:37 pm Post subject: Parse Error on Line 20 |
|
|
I updated my site's layout and when I loaded the page for the blog, it said there was a parse error on line 20. I looked over the code, and didn't see anything wrong with it, but evidently I'm wrong... Here's the code, if you need to see it.
Code: | <html>
<head><title>Main</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div>
<?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1; include ("blog.header.php"); ?>
<!-- // b2 loop start -->
<?php while($row = mysql_fetch_object($result)) { start_b2(); ?>
<div style="border-bottom: 1px solid black">
<b style="margin-left: 40px"><?php the_date("mdy","",""); ?> - <?php the_title(); ?></b>
</div>
<?php permalink_anchor(); ?>
<?php the_content(); ?><?php link_pages("<br />Pages: ","<br />","number") ?>
<div align="right" style="border-top: 1px solid black; text-align: right">
<a href="mailto:[email protected]"><?php the_author() ?></a> said <?php get_words()?> goodbyes<br>
<a href="<?php comments_link() ?>"><?php comments_number("No goodbyes", "1 goodbye", "% goodbyes") ?></a> [ <a href="ink/index.html" target="_blank" title="Dream Weave - My portfolio">1</a> ][ <a href="kredenza/index.html" target="_blank" title="Kredenza - My collective">2</a> ]
</div>
</body>
</html>
|
It's an iframe page, is why it's so simple... Anyone can help..?[/code] _________________ shinobi168
I'm not in the business of faking to please vain opposers
A dead legion of new, cloned followers
Fake Sky |
|
Back to top |
|
 |
stevem
Joined: 15 Mar 2003 Posts: 93
|
Posted: Tue Mar 16, 2004 7:08 pm Post subject: |
|
|
Could it be that in Code: | <?php get_words()?> | you need a space before ?> to give Code: | <?php get_words() ?> |
Line 20 is the last line and if PHP hasn't seen ?> then it thinks ?> should be at the end.
Last edited by stevem on Tue Mar 16, 2004 7:25 pm; edited 1 time in total |
|
Back to top |
|
 |
Jubilee
Joined: 16 Mar 2004 Posts: 5
|
Posted: Tue Mar 16, 2004 7:22 pm Post subject: |
|
|
i know that parse error means that you've added or accidently taken away a ' or , or anything like that |
|
Back to top |
|
 |
shinobi168
Joined: 15 Mar 2004 Posts: 9 Location: Indiana
|
Posted: Tue Mar 16, 2004 9:37 pm Post subject: |
|
|
That didn't work... I checked the coding, and it looked like everything that was there was suppose to be.
I found I didn't close one of my DIV tags, so I closed that, and now it says there's a parse error on line 21.
Code: |
<html>
<head><title>Main</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div>
<?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1; include ("blog.header.php"); ?>
<!-- // b2 loop start -->
<?php while($row = mysql_fetch_object($result)) { start_b2(); ?>
<div style="border-bottom: 1px solid black">
<b style="margin-left: 40px"><?php the_date("mdy","",""); ?> - <?php the_title(); ?></b>
</div>
<?php permalink_anchor(); ?>
<?php the_content() ?><?php link_pages("<br />Pages: ","<br />","number") ?>
<div align="right" style="border-top: 1px solid black; text-align: right">
<a href="mailto:[email protected]"><?php the_author() ?></a> said <?php get_words() ?> goodbyes<br>
<a href="<?php comments_link() ?>"><?php comments_number("No goodbyes","1 goodbye","% goodbyes") ?></a> [ <a
href="ink/index.html" target="_blank" title="Dream Weave - My portfolio">1</a> ][ <a href="kredenza/index.html"
target="_blank" title="Kredenza - My collective">2</a> ]
</div>
</div>
</body>
</html>
|
That's what the code looks like now...
Would I maybe need to change it XHTML standards..? _________________ shinobi168
I'm not in the business of faking to please vain opposers
A dead legion of new, cloned followers
Fake Sky |
|
Back to top |
|
 |
stevem
Joined: 15 Mar 2003 Posts: 93
|
Posted: Tue Mar 16, 2004 10:08 pm Post subject: |
|
|
I don't think PHP cares about HTML errors so it wouldn't be the missing /div. But it is significant that it now says line 21 because it is the new end of file. It means that PHP is missing something earlier on and is looking through the rest of the file for it.
I was going to say add ; after get_words() and other similar places but there's something else I have just seen is missing!
Code: | <?php while($row = mysql_fetch_object($result)) { start_b2(); ?> | doesn't end the while loop with }
You have left out the following lines which should come before <body>
Code: | <!-- // this is just the end of the motor - don't touch that line either :) -->
<?php } ?> | This line closes the loop |
|
Back to top |
|
 |
shinobi168
Joined: 15 Mar 2004 Posts: 9 Location: Indiana
|
Posted: Tue Mar 16, 2004 10:25 pm Post subject: |
|
|
Thanks That brought my blog back. But now the comment link doesn't work! When I click on it, it only loads that single blog entry. No comments or anything. I have it in an iframe, but I don't think that matters, since I've had previous layouts and it never had a problem...
Code: |
<html>
<head><title>Main</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div>
<?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1; include ("blog.header.php"); ?>
<!-- // b2 loop start -->
<?php while($row = mysql_fetch_object($result)) { start_b2(); ?>
<div style="border-bottom: 1px solid black">
<b style="margin-left: 40px"><?php the_date("mdy","",""); ?> - <?php the_title(); ?></b>
</div>
<?php permalink_anchor(); ?>
<?php the_content() ?><?php link_pages("<br />Pages: ","<br />","number") ?>
<div align="right" style="border-top: 1px solid black; text-align: right">
<a href="mailto:[email protected]"><?php the_author() ?></a> said <?php get_words() ?> goodbyes<br>
<a href="<?php comments_link() ?>"><?php comments_number("No goodbyes","1 goodbye","% goodbyes") ?></a> [ <a href="ink/index.html" target="_blank" title="Dream Weave - My portfolio">1</a> ][ <a href="kredenza/index.html" target="_blank" title="Kredenza - My collective">2</a> ]
</div>
</div>
<!-- // this is just the end of the motor - don't touch that line either :) -->
<?php } ?>
</body>
</html>
|
I don't know... I added the piece of PHP you gave me before the </body> tag... I didn't think that affects it... But maybe it does... _________________ shinobi168
I'm not in the business of faking to please vain opposers
A dead legion of new, cloned followers
Fake Sky |
|
Back to top |
|
 |
stevem
Joined: 15 Mar 2003 Posts: 93
|
Posted: Tue Mar 16, 2004 10:50 pm Post subject: |
|
|
You have changed things so much from the standard index.php file that there appears to be things that I have that are missing from yours. For example Code: | <?php include ("b2comments.php"); ?> | which loads the comments.
Have a look back at what you had originally and what you've changed. I presume you must have left out more than just the lines that brought back the blog. |
|
Back to top |
|
 |
shinobi168
Joined: 15 Mar 2004 Posts: 9 Location: Indiana
|
Posted: Wed Mar 17, 2004 9:42 pm Post subject: |
|
|
I don't have the original file... It got deleted when I changed my layout. I'm just downloading b2... I'll look at the file through that. Thanks for the help. _________________ shinobi168
I'm not in the business of faking to please vain opposers
A dead legion of new, cloned followers
Fake Sky |
|
Back to top |
|
 |
|