X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   php includes and smarty (https://forum.x-cart.com/showthread.php?t=10368)

scott_dev 11-14-2004 11:32 AM

php includes and smarty
 
I placed this code on home.tpl:

{include file="/home/mags/public_html/ecommerce/myphp/welcome.php"}

And received this warning:

Warning: Smarty error: unable to read resource: ""/home/10/public_html/ecommerce/myphp/welcome.php"" in /home/mags/public_html/ecommerce/Smarty-2.6.3/Smarty.class.php on line 1082

And this:

{php}
include "/home/10/public_html/ecommerce/myphp/welcome.php";
{/php}


And this:


<?php
include("/home/10/public_html/ecommerce/myphp/welcome.php");

?>


And this:


<?php
include("/home/10/public_html/ecommerce/myphp/welcome.inc");

?>

And only the code appeared on the page.

What am I doing wrong?

Jon 11-14-2004 12:28 PM

In your welcome.php

Do you have php tags at the start and finish?

Code:

<?

Your welcome.php code;

?>


scott_dev 11-14-2004 09:27 PM

It looked like this:

<?php
#
# You can place your php here for the WELCOME PAGE of your site
#

$the_welcome="hello";
echo $the_welcome;
?>


<html>
<body>
</body>
</html>


The I tried:

<?php
#
# You can place your php here for the WELCOME PAGE of your site
#

$the_welcome="hello";
echo $the_welcome;


<html>
<body>
</body>
</html>

?>

An received this error:

Parse error: parse error, unexpected '>' in /home/10/public_html/ecommerce/myphp/welcome.php on line 10

Gijs 11-14-2004 09:42 PM

Hi try this

Code:

{php}
include("/home/10/public_html/ecommerce/myphp/welcome.php");
{/php}


In welcome.php

Code:

<?
$the_welcome="hello";
?>
<html>
<body>
<?
echo $the_welcome;
?>
</body>
</html>



All times are GMT -8. The time now is 07:28 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.