By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,514 Members | 1,308 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,514 IT Pros & Developers. It's quick & easy.

New ITX (HTML_Template_ITX) user needs help!

P: n/a
I'm just getting started with ITX and am having problems with variables
containing $ and numbers.

The relevant portion of the tpl file is:

<form method="POST">
<p>
<input type="submit" value="Submit" name="Sites">
<!-- BEGIN SITES -->
<input type='checkbox' name='{URL1}' value='ON'>{URL2}<br>
<!-- END SITES -->
</p>
</form>

The relevant portion of the php setting the variables is:

foreach($x as $k=>$v){
$tpl->setVariable('URL1',str_replace(' ','',$v));
$tpl->setVariable('URL2',$v);
$tpl->parseCurrentBlock();
}

The values being set include:

Fast $3B Bank
Fast Internet Only Bank

What I'm getting for output is:

<input type='checkbox' name='FastBBank' value='ON'>'Fast B Bank'<br>
<input type='checkbox' name='FastInternetOnlyBank' value='ON'>'Fast
Internet Only Bank'<br>

What's happening to the $3?

Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
It turns out that $ is special within values in ITX and must be
escaped with '\'.
On 8 Dec 2004 11:57:43 -0800, "puff" <rb********@earthlink.net> wrote:
I'm just getting started with ITX and am having problems with variables
containing $ and numbers.

The relevant portion of the tpl file is:

<form method="POST">
<p>
<input type="submit" value="Submit" name="Sites">
<!-- BEGIN SITES -->
<input type='checkbox' name='{URL1}' value='ON'>{URL2}<br>
<!-- END SITES -->
</p>
</form>

The relevant portion of the php setting the variables is:

foreach($x as $k=>$v){
$tpl->setVariable('URL1',str_replace(' ','',$v));
$tpl->setVariable('URL2',$v);
$tpl->parseCurrentBlock();
}

The values being set include:

Fast $3B Bank
Fast Internet Only Bank

What I'm getting for output is:

<input type='checkbox' name='FastBBank' value='ON'>'Fast B Bank'<br>
<input type='checkbox' name='FastInternetOnlyBank' value='ON'>'Fast
Internet Only Bank'<br>

What's happening to the $3?


Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.