Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Insert PHP code into HTML...how ?


z0rr0

Recommended Posts

Posted

I have this html/php code:

<span class=m123> Sortare: <b>pret</b> <a href="'.tep_create_sort_heading_link_content($HTTP_GET_VARS['sort'], 3, 'a', $cPath).'" ><img src=images/stt.gif border=0 alt=Crescator></a>

<a href="'.tep_create_sort_heading_link_content($HTTP_GET_VARS['sort'], 3, 'd', $cPath).'" ><img src=images/stb.gif border=0 alt=Descrescator></a>

<b>»</b>

 

<b>producator</b>

 

/// HERE SHOULD BE THE PHP CODE

 

</span></tr>

<tr><td height=3></td></tr>

<tr><td colspan=3 bgcolor=#d1d4db height=3></td></tr>

<tr><td height=11></td></tr>

<tr>

 

 

';

 

And I have a simple php code:

<?php

 

 

include(DIR_WS_BOXES . 'manufacturers.php');

?>

 

 

How do I insert it there ?

Sorry if it's a stupid question but I am new at this :(

Thanks

Cumparaturi4all

Posted

This seems a very simple question to which the answer is use a text editor such as notepad.

 

Or do you need to know how to get the file from your server, edit it and back onto your site?

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Posted
This seems a very simple question to which the answer is use a text editor such as notepad.

 

Or do you need to know how to get the file from your server, edit it and back onto your site?

 

I mean how to insert this code:

<?php

 

 

include(DIR_WS_BOXES . 'manufacturers.php');

?>

 

 

Into the first one (where it says /// HERE SHOULD BE THE PHP CODE ) :blush:

 

I've tried :

 

<span class=m123> Sortare: <b>pret</b> <a href="'.tep_create_sort_heading_link_content($HTTP_GET_VARS['sort'], 3, 'a', $cPath).'" ><img src=images/stt.gif border=0 alt=Crescator></a>

<a href="'.tep_create_sort_heading_link_content($HTTP_GET_VARS['sort'], 3, 'd', $cPath).'" ><img src=images/stb.gif border=0 alt=Descrescator></a>

<b>»</b>

 

<b>producator</b>

 

'. include(DIR_WS_BOXES . 'manufacturers.php'); .'

 

</span></tr>

<tr><td height=3></td></tr>

<tr><td colspan=3 bgcolor=#d1d4db height=3></td></tr>

<tr><td height=11></td></tr>

<tr>

 

 

';

but it's not working

Cumparaturi4all

Posted

Try

 

<?php

include(DIR_WS_BOXES . 'manufacturers.php');

?>

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Posted
Try

 

<?php

include(DIR_WS_BOXES . 'manufacturers.php');

?>

 

Nop,tried that and get error:

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in... on line 96

 

and the line 96 is :

<?php

include(DIR_WS_BOXES . 'manufacturers.php');

?>

Cumparaturi4all

Posted

Try this -

 

<span class=m123> Sortare: <b>pret</b> <a href="'.tep_create_sort_heading_link_content($HTTP_GET_VARS['sort'], 3, 'a', $cPath).'" ><img src=images/stt.gif border=0 alt=Crescator></a>
<a href="'.tep_create_sort_heading_link_content($HTTP_GET_VARS['sort'], 3, 'd', $cPath).'" ><img src=images/stb.gif border=0 alt=Descrescator></a>
<b>»</b>

<b>producator</b> 

<?php
include(DIR_WS_BOXES . 'manufacturers.php');
?>

</span></tr>
<tr><td height=3></td></tr> 
<tr><td colspan=3 bgcolor=#d1d4db height=3></td></tr> 
<tr><td height=11></td></tr> 
<tr>

 

Make sure you remove this -

</span></tr>
<tr><td height=3></td></tr>
<tr><td colspan=3 bgcolor=#d1d4db height=3></td></tr>
<tr><td height=11></td></tr>
<tr>


';		<<<<<<<<<<-----------------------This is causing the T_STRING parse error!

Posted
Try this -

 

<span class=m123> Sortare: <b>pret</b> <a href="'.tep_create_sort_heading_link_content($HTTP_GET_VARS['sort'], 3, 'a', $cPath).'" ><img src=images/stt.gif border=0 alt=Crescator></a>
<a href="'.tep_create_sort_heading_link_content($HTTP_GET_VARS['sort'], 3, 'd', $cPath).'" ><img src=images/stb.gif border=0 alt=Descrescator></a>
<b>»</b>

<b>producator</b> 

<?php
include(DIR_WS_BOXES . 'manufacturers.php');
?>

</span></tr>
<tr><td height=3></td></tr> 
<tr><td colspan=3 bgcolor=#d1d4db height=3></td></tr> 
<tr><td height=11></td></tr> 
<tr>

 

Make sure you remove this -

</span></tr>
<tr><td height=3></td></tr>
<tr><td colspan=3 bgcolor=#d1d4db height=3></td></tr>
<tr><td height=11></td></tr>
<tr>
';		<<<<<<<<<<-----------------------This is causing the T_STRING parse error!

 

 

Nop didn't work...exactly the same error and the same line (96) :blink:

Cumparaturi4all

Posted

Confirm which line is line 96.

 

Is it actually the 'include(DIR_WS_BOXES . 'manufacturers.php');' line?

 

As far as I'm concerned. To insert the manufacturers box in that place, that is all that is needed.

 

The T_STRING is usually a very minor one.

Posted
Confirm which line is line 96.

 

Is it actually the 'include(DIR_WS_BOXES . 'manufacturers.php');' line?

 

As far as I'm concerned. To insert the manufacturers box in that place, that is all that is needed.

 

The T_STRING is usually a very minor one.

 

Yes it's the include(DIR_WS_BOXES . 'manufacturers.php'); line.

 

This whole code is in a <?php already ,if it helps to know.

Cumparaturi4all

Posted

The html is already being parsed by PHP so there is no need to use <?php ?>

 

Use the following: -

 

<span class=m123> Sortare: <b>pret</b> <a href="'.tep_create_sort_heading_link_content($HTTP_GET_VARS['sort'], 3, 'a', $cPath).'" ><img src=images/stt.gif border=0 alt=Crescator></a>
<a href="'.tep_create_sort_heading_link_content($HTTP_GET_VARS['sort'], 3, 'd', $cPath).'" ><img src=images/stb.gif border=0 alt=Descrescator></a>
<b>»</b>

<b>producator</b>';
include(DIR_WS_BOXES . 'manufacturers.php');
echo '
</span></tr>
<tr><td height=3></td></tr>
<tr><td colspan=3 bgcolor=#d1d4db height=3></td></tr>
<tr><td height=11></td></tr>
<tr>';

Posted
The html is already being parsed by PHP so there is no need to use <?php ?>

 

Use the following: -

 

<span class=m123> Sortare: <b>pret</b> <a href="'.tep_create_sort_heading_link_content($HTTP_GET_VARS['sort'], 3, 'a', $cPath).'" ><img src=images/stt.gif border=0 alt=Crescator></a>
<a href="'.tep_create_sort_heading_link_content($HTTP_GET_VARS['sort'], 3, 'd', $cPath).'" ><img src=images/stb.gif border=0 alt=Descrescator></a>
<b>»</b>

<b>producator</b>';
include(DIR_WS_BOXES . 'manufacturers.php');
echo '
</span></tr>
<tr><td height=3></td></tr>
<tr><td colspan=3 bgcolor=#d1d4db height=3></td></tr>
<tr><td height=11></td></tr>
<tr>';

 

 

:thumbsup:

 

Thanks a lot

Cumparaturi4all

Posted
If it's all in a PHP doesnt the first lot need to in an echo tag too?

 

 

It was but we were only seeing some of the code.

Archived

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

×
×
  • Create New...