•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,610 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,507 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1835 | Replies: 22
![]() |
•
•
Join Date: Nov 2007
Posts: 10
Reputation:
Rep Power: 2
Solved Threads: 0
Hey guys im really new to php and i had it all worked out untill this came along
it says this
i really really dont know what to do and i would be so grateful if someone could tell me what is wrong
here is the code
it says this
Parse error: syntax error, unexpected T_STRING in /home/tattie/public_html/index.php on line 1
i really really dont know what to do and i would be so grateful if someone could tell me what is wrong
here is the code
<!--THIS INCLUDES HEADER.PHP--><? php get_header(); ?><!-- END -->
<div class="side"><?php if (have_posts()) : ?>
<?php $post = $posts[0]; // Thanks Kubrick for this code ?>
<?php if (is_category()) { ?>
<h3><?php _e('Archive for '); echo single_cat_title(); ?></h3>
<?php } elseif (is_day()) { ?>
<h3><?php _e('Archive for '); the_time('F j, Y'); ?></h3>
<?php } elseif (is_month()) { ?>
<h3><?php _e('Archive for '); the_time('F, Y'); ?></h3>
<?php } elseif (is_year()) { ?>
<h2><?php _e('Archive for '); the_time('Y'); ?></h2>
<?php } elseif (is_author()) { ?>
<h3><?php _e('Author Archive'); ?></h3>
<?php } elseif (is_search()) { ?>
<h3><?php _e('Search Results'); ?></h3>
<?php } ?>
<?php while (have_posts()) : the_post(); ?>
<!--TITLE TAG-->
<h1><?php the_title(); ?></h1>
<!--END-->
<!--TIME DATE CATEGORY WORDS-->
<h2><?php the_time('F jS, Y'); ?> by <?php the_author(); ?> <?php comments_popup_link(__('0 Comments'), __('1 Comment'), __('% Comments'), 'commentslink', __('sorry, Comments off for this post.')); ?> <BR>
Filed Under: <?php the_category(', ') ?>
</h2>
<!--END-->
<?php if (is_search()) { ?>
<?php the_excerpt() ?>
<?php } else { ?>
<?php the_content(__('Read more »')); ?>
<!--COMMENTS TAG-->
<!--END-->
<br /> <br />
<?php comments_template(); // Get wp-comments.php template ?>
<?php } ?>
<!--
<?php trackback_rdf(); ?>
-->
<?php endwhile; ?>
<?php posts_nav_link('', __(''), __('« Previous entries')); ?>
<?php posts_nav_link(' ', __(''), __('')); ?>
<?php posts_nav_link('', __('Next entries »'), __('')); ?>
<?php else : ?>
<h3><?php _e('Not Found'); ?></h3>
<p><?php _e('Sorry, but no posts matched your criteria.'); ?></p>
<?php endif; ?>
</div>
<!--THIS INCLUDES FOOTER.PHP-->
<?php get_footer(); ?><!-- END --> •
•
Join Date: Aug 2007
Location: Morrisdale, PA
Posts: 52
Reputation:
Rep Power: 2
Solved Threads: 5
•
•
Join Date: Nov 2007
Posts: 10
Reputation:
Rep Power: 2
Solved Threads: 0
thanks so much bit it is still not working
http://www.janetjackson.org.uk it still shows the same message
http://www.janetjackson.org.uk it still shows the same message
•
•
Join Date: Aug 2007
Location: Morrisdale, PA
Posts: 52
Reputation:
Rep Power: 2
Solved Threads: 5
Look through code for additional errors as notated between lines
////////////////
///////////////
////////////////
///////////////
•
•
•
•
Hey guys im really new to php and i had it all worked out untill this came along
it says this
Parse error: syntax error, unexpected T_STRING in /home/tattie/public_html/index.php on line 1
i really really dont know what to do and i would be so grateful if someone could tell me what is wrong
here is the code
<!--THIS INCLUDES HEADER.PHP--><? php get_header(); ?><!-- END --> ///////////// Above make sure you chnge <? php to <?php note no spacing /////////////// <div class="side"><?php if (have_posts()) : ?> <?php $post = $posts[0]; // Thanks Kubrick for this code ?> <?php if (is_category()) { ?> ///////////// Above need to end your php with a ; ?> ////////////////// <h3><?php _e('Archive for '); echo single_cat_title(); ?></h3> <?php } elseif (is_day()) { ?> ///////////// Above need to end your php with a ;?> /////////// <h3><?php _e('Archive for '); the_time('F j, Y'); ?></h3> <?php } elseif (is_month()) { ?> ///////////// Above need to end your php with a ;?> ////////////////// <h3><?php _e('Archive for '); the_time('F, Y'); ?></h3> <?php } elseif (is_year()) { ?> ///////////// Above need to end your php with a ;?> /////////////// <h2><?php _e('Archive for '); the_time('Y'); ?></h2> <?php } elseif (is_author()) { ?> ///////////// Above need to end your php with a ;?> ///////////// <h3><?php _e('Author Archive'); ?></h3> <?php } elseif (is_search()) { ?> ///////////// Above need to end your php with a ;?> ////////////// <h3><?php _e('Search Results'); ?></h3> <?php } ?> <?php while (have_posts()) : the_post(); ?> ///////////////////////////////////////////////////////////////// Look above here, once again you have a : instead of an ; ///////////////////////////////////////////////////////////////// <!--TITLE TAG--> <h1><?php the_title(); ?></h1> <!--END--> <!--TIME DATE CATEGORY WORDS--> <h2><?php the_time('F jS, Y'); ?> by <?php the_author(); ?> <?php comments_popup_link(__('0 Comments'), __('1 Comment'), __('% Comments'), 'commentslink', __('sorry, Comments off for this post.')); ?> <BR> Filed Under: <?php the_category(', ') ?> ///////////// Above need to end your php with a ;?> /////////////// </h2> <!--END--> <?php if (is_search()) { ?> ///////////// Above need to end your php with a ;?> /////////////// <?php the_excerpt() ?> ///////////// Above need to end your php with a ;?> //////////////// <?php } else { ?> ///////////// Above need to end your php with a ;?> /////////////// <?php the_content(__('Read more »')); ?> <!--COMMENTS TAG--> <!--END--> <br /> <br /> <?php comments_template(); // Get wp-comments.php template ?> <?php } ?> ///////////// Above need to end your php with a ;?> /////////////// <!-- <?php trackback_rdf(); ?> --> <?php endwhile; ?> <?php posts_nav_link('', __(''), __('« Previous entries')); ?> <?php posts_nav_link(' ', __(''), __('')); ?> <?php posts_nav_link('', __('Next entries »'), __('')); ?> <?php else : ?> //////////////////// Above once again using a : instead of ; //////////////// <h3><?php _e('Not Found'); ?></h3> <p><?php _e('Sorry, but no posts matched your criteria.'); ?></p> <?php endif; ?> </div> <!--THIS INCLUDES FOOTER.PHP--> <?php get_footer(); ?><!-- END -->
Last edited by JeniF : Nov 10th, 2007 at 2:48 pm. Reason: additional error correction
I keep hitting "escape", but I'm still here!!!!
:}
:}
•
•
Join Date: Nov 2007
Posts: 10
Reputation:
Rep Power: 2
Solved Threads: 0
right ok i think i have most of it fixed..here is the new code
it says its wrong on line 55 but i cant see it
here if 55 btw
<?php endwhile: ?>
<!--THIS INCLUDES HEADER.PHP--><?php get_header() ;?><!-- END -->
<div class="side"><?php if (have_posts()) ;?>
<?php $post = $posts[0]; // Thanks Kubrick for this code ;?>
<?php if (is_category()) { ;?>
<h3><?php _e('Archive for '); echo single_cat_title() ;?></h3>
<?php } elseif (is_day()) { ;?>
<h3><?php _e('Archive for '); the_time('F j, Y') ;?></h3>
<?php } elseif (is_month()) { ;?>
<h3><?php _e('Archive for '); the_time('F, Y') ;?></h3>
<?php } elseif (is_year()) { ;?>
<h2><?php _e('Archive for '); the_time('Y') ;?></h2>
<?php } elseif (is_author()) { ;?>
<h3><?php _e('Author Archive') ;?></h3>
<?php } elseif (is_search()) { ;?>
<h3><?php _e('Search Results') ;?></h3>
<?php } ;?>
<?php while (have_posts()) ; the_post() ;?>
<!--TITLE TAG-->
<h1><?php the_title() ;?></h1>
<!--END-->
<!--TIME DATE CATEGORY WORDS-->
<h2><?php the_time('F jS, Y'); ;?> by <?php the_author(); ;?> <?php comments_popup_link(__('0 Comments'), __('1 Comment'), __('% Comments'), 'commentslink', __('sorry, Comments off for this post.')) ;?> <BR>
Filed Under: <?php the_category(', ') ;?>
</h2>
<!--END-->
<?php if (is_search()) { ;?>
<?php the_excerpt() ;?>
<?php } else { ;?>
<?php the_content(__('Read more »'));?>
<!--COMMENTS TAG-->
<!--END-->
<br /> <br />
<?php comments_template(); // Get wp-comments.php template ;?>
<?php } ;?>
<!--
<?php trackback_rdf() ;?>
-->
<?php endwhile: ?>
<?php posts_nav_link('', __(''), __('« Previous entries')): ?>
<?php posts_nav_link(' ', __(''), __('')): ?>
<?php posts_nav_link('', __('Next entries »'), __('')): ?>
<?php else ; ?>
<h3><?php _e('Not Found'); ?></h3>
<p><?php _e('Sorry, but no posts matched your criteria.'); ?></p>
<?php endif; ?>
</div>
<!--THIS INCLUDES FOOTER.PHP-->
<?php get_footer(); ?><!-- END -->it says its wrong on line 55 but i cant see it
here if 55 btw
<?php endwhile: ?>
Found your problem. You are starting the while loop with a semicolon instead of a colon. It's unusual to see while: and endwhile; in php. Most of us just use braces. Anyway here's what you need to do:
line 23: <?php while (have_posts()): the_post() ;?>
Also make sure 55 has the semicolon.
Also
Line 3 should be: <?php if (have_posts()) :?>
and
Line 60 should be: <?php ; else: ?>
line 23: <?php while (have_posts()): the_post() ;?>
Also make sure 55 has the semicolon.
Also
Line 3 should be: <?php if (have_posts()) :?>
and
Line 60 should be: <?php ; else: ?>
Last edited by buddylee17 : Nov 10th, 2007 at 8:45 pm.
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- error "cannot find server- Microsoft Internet Explorer". (Web Browsers)
- Check my code, There is 1 error, cant find it (C++)
- Runtime error:453 cannot find dllentrypoint (Visual Basic 4 / 5 / 6)
- HELP! t_string error (PHP)
- DNS error cannot find server (Windows NT / 2000 / XP / 2003)
- syntax error that I just can't seem to find! (Visual Basic 4 / 5 / 6)
- "Cannot find server or DNS Error" (Web Browsers)
Other Threads in the PHP Forum
- Previous Thread: Using mysqli_bind_param with an unknown number of variables
- Next Thread: PHP Classes


Linear Mode