Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

php includes and smarty

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-14-2004, 11:32 AM
 
scott_dev scott_dev is offline
 

Member
  
Join Date: May 2004
Location: San Diego, California
Posts: 12
 

Default 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?
__________________
Scott Robinson
X-Cart 4.0.0 - Heavily Modified
PHP version 4.3.9
Operating system Linux
Kernel version 2.6.8.1
Machine Type i686
Apache version 1.3.32 (Unix)
PERL version 5.8.4
MySQL version 4.0.20-standard
Reply With Quote
  #2  
Old 11-14-2004, 12:28 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

In your welcome.php

Do you have php tags at the start and finish?

Code:
<? Your welcome.php code; ?>
Reply With Quote
  #3  
Old 11-14-2004, 09:27 PM
 
scott_dev scott_dev is offline
 

Member
  
Join Date: May 2004
Location: San Diego, California
Posts: 12
 

Default

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
__________________
Scott Robinson
X-Cart 4.0.0 - Heavily Modified
PHP version 4.3.9
Operating system Linux
Kernel version 2.6.8.1
Machine Type i686
Apache version 1.3.32 (Unix)
PERL version 5.8.4
MySQL version 4.0.20-standard
Reply With Quote
  #4  
Old 11-14-2004, 09:42 PM
  Gijs's Avatar 
Gijs Gijs is offline
 

eXpert
  
Join Date: Aug 2004
Location: Belgium
Posts: 295
 

Default

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>
__________________
X-cart 4.1.11
PHP 5 MySQL 5
www.wheelpalace.eu
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:56 AM.

   

 
X-Cart forums © 2001-2020