Code: Select all
<INPUT name="Name" type="text" value="<?php echo stripslashes($Row['CompName']); ?>">At what point does it become better to just stay in php mode and echo all of the html instead of jumping in and out of the php mode?
Moderator: General Moderators
Code: Select all
<INPUT name="Name" type="text" value="<?php echo stripslashes($Row['CompName']); ?>">Code: Select all
<?php
// here Logic
// Get row from database
$var1=stripslashes($Row['CompName'];
$var2="I dont know whatever';
?>
<html>
...
<INPUT name="Name" type="text" value="<?php echo $var1 ?>">
...
</html>Code: Select all
<P>Contact Name </P>
<?php
if (isset($Qname)) echo "<H1>First:</H1>\n";
else echo "<P>First:</P>\n";
?>
<INPUT name="FirstName" type="text" class='forminp' style="width:150px" value="<?php echo stripslashes($Row['First']); ?>">
<?php
if (isset($Qname)) echo "<H1>Last:</H1>\n";
else echo "<P>Last:</P>\n";
?>
<INPUT name="LastName" type="text" class='forminp' style="width:150px" value="<?php echo stripslashes($Row['Last']); ?>">
<P>Address</P>Code: Select all
<p>Contact Name </p>
<?php if (isset($Qname)) { ?>
<h1>First:</h1>
<h1>Last:</h1>
<?php } else { ?>
<p>First:</p>
<input name="FirstName" type="text" class='forminp' style="width:150px" value="<?php echo $Row['First']; ?>">
<p>Last:</[>
<input name="LastName" type="text" class='forminp' style="width:150px" value="<?php echo $Row['Last']; ?>">
<p>Address</p>Code: Select all
<?php
if (isset($Qname)) echo "<H1>First:</H1>\n";
else echo "<P>First:</P>\n";
?>
<INPUT name="FirstName" type="text" class='forminp' style="width:150px"
value="<?php echo $Row['First']; ?>">
<?php
if (isset($Qname)) echo "<H1>Last:</H1>\n";
else echo "<P>Last:</P>\n";
?>
<INPUT name="LastName" type="text" class='forminp' style="width:150px"
value="<?php echo $Row['Last']; ?>">Code: Select all
<?php
if (isset($Qname)) echo "<H1>First:</H1>\n";
else echo "<P>First:</P>\n";
echo "<INPUT name='FirstName' type='text' class='forminp' style='width:150px' value=",$Row['First']),">";
if (isset($Qname)) echo "<H1>Last:</H1>\n";
else echo "<P>Last:</P>\n";
echo "<INPUT name='LastName' type='text' class='forminp' style='width:150px' value=",$Row['Last']),">";
?>Code: Select all
<?php echo (isset($Qname)) ? "<H1>First:</H1>\n" : "<P>First:</P>\n" ; ?>
<INPUT name="FirstName" type="text" class='forminp' style="width:150px" value="<?php echo $Row['First']; ?>">
<?php echo (isset($Qname)) ? "<H1>First:</H1>\n" : "<P>First:</P>\n" ; ?>
<INPUT name="LastName" type="text" class='forminp' style="width:150px" value="<?php echo $Row['Last']; ?>">Code: Select all
/* Magic quotes normalization */
if (get_magic_quotes_gpc()) {
$input = array(&$_GET, &$_POST, &$_COOKIE, &$_ENV, &$_SERVER);
while (list($k,$v) = each($input)) {
foreach ($v as $key => $val) {
if (!is_array($val)) {
$input[$k][$key] = stripslashes($val);
continue;
}
$input[] =& $input[$k][$key];
}
}
unset($input);
}I haven't worked with template lite yet. But what do you mean with this? First you say mash is difficult to read, then that you love them? Sorry if I misunderstood or for my complete ignoranceEverah wrote:I look into TemplateLite as a template engine. If not for the templating, then just to see the mash that the cached templates look like. Mash hashes of code/presentation are hard to read, harder to maintain and difficult to modify later on. I have been using templates for a long time now and I couldn't love them more.
Code: Select all
{if $query_debug == true }
<SCRIPT language=javascript>
_query_debug_console = window.open("","Query Debug","width=750,height=600,resizable,scrollbars=yes");
_query_debug_console.document.write("<HTML><TITLE>Query Debug Console</TITLE><BODY onload='self.focus();' bgcolor=#ffffff>");
_query_debug_console.document.write("<table border=0 width=100%>");
_query_debug_console.document.write("<tr bgcolor=#cccccc><th colspan=2>Query Debug Console</th></tr>");
_query_debug_console.document.write("<tr bgcolor=#cccccc><td colspan=2><b>Included page queries (load time in seconds):</b></td></tr>");
{foreach key=key value=sql from=$query_list}
_query_debug_console.document.write("<tr bgcolor={if $key % 2}#eeeeee{else}#fafafa{/if}>");
_query_debug_console.document.write('<td width="75%">{$query_list[$key]|strip|addslashes }<hr><font color=\"red\"><b>{$query_list_errors[$key]|strip|addslashes}</b></font></td>');
_query_debug_console.document.write("<td width=\"25%\"><font color=\"red\"><b><i>({$query_list_time[$key]|string_format:"%.5f"} seconds)</i></b></font></td></tr>");
{/foreach}
_query_debug_console.document.write("</table>");
_query_debug_console.document.write("</BODY></HTML>");
_query_debug_console.document.close();
</SCRIPT>
{/if}
Code: Select all
<?php if ($this->_vars['query_debug'] == true): ?>
<SCRIPT language=javascript>
_query_debug_console = window.open("","Query Debug","width=750,height=600,resizable,scrollbars=yes");
_query_debug_console.document.write("<HTML><TITLE>Query Debug Console</TITLE><BODY onload='self.focus();' bgcolor=#ffffff>");
_query_debug_console.document.write("<table border=0 width=100%>");
_query_debug_console.document.write("<tr bgcolor=#cccccc><th colspan=2>Query Debug Console</th></tr>");
_query_debug_console.document.write("<tr bgcolor=#cccccc><td colspan=2><b>Included page queries (load time in seconds):</b></td></tr>");
<?php if (count((array)$this->_vars['query_list'])): foreach ((array)$this->_vars['query_list'] as $this->_vars['key'] => $this->_vars['sql']): ?>
_query_debug_console.document.write("<tr bgcolor=<?php if ($this->_vars['key'] % 2): ?>#eeeeee<?php else: ?>#fafafa<?php endif; ?>>");
_query_debug_console.document.write('<td width="75%"><?php echo $this->_run_modifier($this->_run_modifier($this->_vars['query_list'][$this->_vars['key']], 'strip', 'plugin', 1), 'addslashes', 'PHP', 1); ?>
<hr><font color=\"red\"><b><?php echo $this->_run_modifier($this->_run_modifier($this->_vars['query_list_errors'][$this->_vars['key']], 'strip', 'plugin', 1), 'addslashes', 'PHP', 1); ?>
</b></font></td>');
_query_debug_console.document.write("<td width=\"25%\"><font color=\"red\"><b><i>(<?php echo $this->_run_modifier($this->_vars['query_list_time'][$this->_vars['key']], 'string_format', 'plugin', 1, "%.5f"); ?>
seconds)</i></b></font></td></tr>");
<?php endforeach; endif; ?>
_query_debug_console.document.write("</table>");
_query_debug_console.document.write("</BODY></HTML>");
_query_debug_console.document.close();
</SCRIPT>
<?php endif; ?>
Code: Select all
<table border="0" align="center">
<tr>
{if $total_signupclosed != $totalgames && $total_closed != $totalgames}
<td width="255">
<a id="newplayer" href="new_player.php"><img border="0" src="templates/{$templatename}images/newplayer.gif" align="left"></a>
</td>
{/if}
{if $total_closed != $totalgames}
<td width="134">
<input type="image" name="login" src="templates/{$templatename}images/login.gif" value="{$l_login_title}">
</td>
{/if}
</tr>
</table>
Code: Select all
<table border="0" align="center">
<tr>
<?php if ($this->_vars['total_signupclosed'] != $this->_vars['totalgames'] && $this->_vars['total_closed'] != $this->_vars['totalgames']): ?>
<td width="255">
<a id="newplayer" href="new_player.php"><img border="0" src="templates/<?php echo $this->_vars['templatename']; ?>
images/newplayer.gif" align="left"></a>
</td>
<?php endif; ?>
<?php if ($this->_vars['total_closed'] != $this->_vars['totalgames']): ?>
<td width="134">
<input type="image" name="login" src="templates/<?php echo $this->_vars['templatename']; ?>
images/login.gif" value="<?php echo $this->_vars['l_login_title']; ?>
">
</td>
<?php endif; ?>
</tr>
</table>