PHP Syntax error - HELP - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming > PHP Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-24-2011, 12:56 PM   #1 (permalink)
Junior Member
 
Join Date: Jul 2011
Location: Philadelphia, PA
Posts: 2
Default PHP Syntax error - HELP

I am receiving the following error.

syntax error, unexpected 'menu', expecting ',' or ';'

Can someone please help me with this please? I would truly appreciate the help. Thanks

Below is my code:

<?php $navbackground = of_get_option('top_background');

if ($topbackground) {
if ($topbackground['image']) {
echo '<div id="navigation" >

<?php wp_nav_menu(array('menu' => 'Main Nav Menu')); ?>
</div>';
} else {
echo '<div id="top" style="background:'.$topbackground['image']. ' "></div>';

}
} else {
echo "No top background selected";
}; ?>
</div><!-- end of innertube -->

</div>
cwjsaw is offline   Reply With Quote
Sponsored Links
Old 07-24-2011, 01:51 PM   #2 (permalink)
Regular User
 
Join Date: May 2011
Location: Germany
Posts: 103
Default Re: PHP Syntax error - HELP

Quote:
Originally Posted by cwjsaw View Post
<?php $navbackground = of_get_option('top_background');
if ($topbackground) {
if ($topbackground['image']) {
echo '<div id="navigation" >
add '; after the 4th line
you did not close the php with ?>

Quote:
Originally Posted by cwjsaw View Post
<?php wp_nav_menu(array('menu' => 'Main Nav Menu')); ?>
Quote:
Originally Posted by cwjsaw View Post
</div>';
} else {
echo '<div id="top" style="background:'.$topbackground['image']. ' "></div>';
}
} else {
echo "No top background selected";
}; ?>
</div><!-- end of innertube -->
</div>
remove the last ; before ?>

Your debugger should show you the line number, where the error takes place.
Riesling is offline   Reply With Quote
Old 07-25-2011, 05:50 PM   #3 (permalink)
Junior Member
 
Join Date: Jul 2011
Location: Philadelphia, PA
Posts: 2
Default Re: PHP Syntax error - HELP

I fixed the the problem, it was a nested php issue.
cwjsaw is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 04:56 PM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting