Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Dedicated server web hosting provided by Guru-host.eu.
Smarty->display() problem

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
mariyam7
Smarty n00b


Joined: 15 Nov 2006
Posts: 2

PostPosted: Wed Nov 15, 2006 1:45 am    Post subject: Smarty->display() problem Reply with quote

Smarty does not render the html file in the browser...it displays the raw html.

if the html file is opened directly it works...
Also IE display the formatted html after a couple of refreshes but Firefox never displays it correctly

the template file(sap_3.tpl.html) looks like this


<html>
<head>
<script type="text/javascript" src="../lib/cpaint/cpaint2.inc.js"></script>
<script type="text/javascript" src="../webroot/js/sap.js"></script>
</head>
<body>
<div>
<form action="" method="POST">
<table>
<tr>
<td>
<select id="zonelist" size="{$zoneNo}">
{html_options values=$zoneID output=$zoneName}
</select>
</td>
<td align="center">
<input type="button" id="add" value="Add" onClick="addZone()"></input><br>
<input type="button" id="moveUp" value="^" onClick="moveUp()"></input><br>
<input type="button" id="moveDown" value="V" onClick="moveDown()"></input><br>
<input type="button" id="delete" value="Delete" onClick="deleteZone()"></input>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>

PLEASE HELP!!!!

--Mariyam
Back to top
View user's profile Send private message
Ez4Me2KU
Smarty n00b


Joined: 20 Aug 2003
Posts: 4

PostPosted: Tue Jan 09, 2007 10:39 am    Post subject: Reply with quote

I think this is not a smarty problem.

PHP may have a header('Content-type: text/plain'); instead of header('Content-type: text/html');

Check your sources with something similar.
Back to top
View user's profile Send private message Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5608
Location: Toronto, Canada

PostPosted: Tue Jan 09, 2007 2:02 pm    Post subject: Reply with quote

Browsers render HTML. Smarty generates text (usually HTML). PHP and your webserver deliver the result to your browser.

Are you trying to browse to your template file directly from your browser? That won't work.
Back to top
View user's profile Send private message
mariyam7
Smarty n00b


Joined: 15 Nov 2006
Posts: 2

PostPosted: Wed Jan 10, 2007 11:20 pm    Post subject: Reply with quote

Thanks!!

But it was a problem due to combination of CPAINT and SMARTY in PHP.

--Mariyam
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP