Jump to content

Archived

This topic is now archived and is closed to further replies.

luigicosta

link php e html for new apprenticeship programmer

Recommended Posts

I can not write in php it seems well established

where I'm wrong? This piece of code?

thanks

 

<div class="grid_24 ui-widget infoBoxContainer">
 <div class="ui-widget-header infoBoxHeading">   <a href="' . tep_href_link(FILENAME_SHIPPING) . '">Spedizioni</a> - <a href="' . tep_href_link(FILENAME_PRIVACY) . '">Condizioni</a> - <a href="' . tep_href_link(FILENAME_CONDITIONS) . '">Privacy</a> - <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">Contattaci</a> - <a href="' . tep_href_link(FILENAME_SITEMAP_SEO) . '">Mappa sito</a></div>
</div>

Share this post


Link to post
Share on other sites

There are various ways to do it. here's one way

<div class="ui-widget-header infoBoxHeading">   <a href="<?php echo tep_href_link(FILENAME_SHIPPING); ?>">Spedizioni</a> - <a href="' . tep_href_link(FILENAME_PRIVACY) . '">Condizioni</a> - <a href="' . tep_href_link(FILENAME_CONDITIONS) . '">Privacy</a> - <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">Contattaci</a> - <a href="<?php echo tep_href_link(FILENAME_SITEMAP_SEO); ?>">Mappa sito</a></div>

Share this post


Link to post
Share on other sites

Any php code need to be within <?php your code here ?> tags. For example the tep_href_link() function you use.

 

maybe you are already in php mode for the code you posted, it's not visible from this snipset

Share this post


Link to post
Share on other sites

Your original post's code assumes that you're already in a PHP section (<?php) and that you're printing out a string: echo ' . And after your code, the string is ended: '; . In other words, your code is a mixture of PHP and HTML, so it must be within a string in a PHP section.

 

At a minimum:

echo '
<div class="grid_24 ui-widget infoBoxContainer">
 <div class="ui-widget-header infoBoxHeading">   <a href="' . tep_href_link(FILENAME_SHIPPING) . '">Spedizioni</a> - <a href="' . tep_href_link(FILENAME_PRIVACY) . '">Condizioni</a> - <a href="' . tep_href_link(FILENAME_CONDITIONS) . '">Privacy</a> - <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">Contattaci</a> - <a href="' . tep_href_link(FILENAME_SITEMAP_SEO) . '">Mappa sito</a></div>
</div>
';

Share this post


Link to post
Share on other sites

×