Mighty Mike Posted December 13, 2004 Posted December 13, 2004 <table border="0" cellspacing="10" cellpadding="0" align="center"> <td align="center" class="main"><?php if (tep_session_is_registered('customer_id')) echo '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=add_wishlist') . '">' . tep_image_button('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST) . '</a>'; } else { '<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_create_account.gif', IMAGE_BUTTON_CREATE_ACCOUNT) . '</a></td>'; } } ?> Parse error: parse error, unexpected T_ELSE :angry: For the life of me i cant get this to work, i have been trying for hours with no luck and was hoping someone could explain what i am doing wrong. :'( I am doing this is product_info, i can get the add wishlist button to display fine but i get stuck when trying to do the "ELSE" thanks
boxtel Posted December 13, 2004 Posted December 13, 2004 <table border="0" cellspacing="10" cellpadding="0" align="center"> <td align="center" class="main"><?php if (tep_session_is_registered('customer_id')) echo '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=add_wishlist') . '">' . tep_image_button('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST) . '</a>'; } else { '<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_create_account.gif', IMAGE_BUTTON_CREATE_ACCOUNT) . '</a></td>'; } } ?> Parse error: parse error, unexpected T_ELSE :angry: For the life of me i cant get this to work, i have been trying for hours with no luck and was hoping someone could explain what i am doing wrong. :'( I am doing this is product_info, i can get the add wishlist button to display fine but i get stuck when trying to do the "ELSE" thanks <{POST_SNAPBACK}> think you forgot the opening { Treasurer MFC
bitshiff Posted December 13, 2004 Posted December 13, 2004 <td align="center" class="main"> <?php if (tep_session_is_registered('customer_id')) { echo '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action= add_wishlist') . '">' . tep_image_button('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST) . '</a>'; } else { '<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_create_account.gif', IMAGE_BUTTON_CREATE_ACCOUNT) . '</a></td>'; } ?> the else statement comes totally behind the if in curly-braces..
boxtel Posted December 13, 2004 Posted December 13, 2004 <td align="center" class="main"><?php if (tep_session_is_registered('customer_id')) { echo '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action= add_wishlist') . '">' . tep_image_button('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST) . '</a>'; } else { '<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_create_account.gif', IMAGE_BUTTON_CREATE_ACCOUNT) . '</a></td>'; } ?> the else statement comes totally behind the if in curly-braces.. <{POST_SNAPBACK}> yes but don't forget the echo in the else statement: <td align="center" class="main"> <?php if (tep_session_is_registered('customer_id')) { echo '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action= add_wishlist') . '">' . tep_image_button('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST) . '</a>'; } else { echo '<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_create_account.gif', IMAGE_BUTTON_CREATE_ACCOUNT) . '</a></td>'; } ?> Treasurer MFC
Mighty Mike Posted December 13, 2004 Author Posted December 13, 2004 Thank you both for your help. :thumbsup: Works like a dream :D Learn something new everyday :rolleyes:
Recommended Posts
Archived
This topic is now archived and is closed to further replies.