New ITX (HTML_Template_ITX) user needs help!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • puff

    New ITX (HTML_Template_ITX) user needs help!

    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'>{URL 2}<br>
    <!-- END SITES -->
    </p>
    </form>

    The relevant portion of the php setting the variables is:

    foreach($x as $k=>$v){
    $tpl->setVariable('U RL1',str_replac e(' ','',$v));
    $tpl->setVariable('U RL2',$v);
    $tpl->parseCurrentBl ock();
    }

    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'>'Fas t B Bank'<br>
    <input type='checkbox' name='FastInter netOnlyBank' value='ON'>'Fas t
    Internet Only Bank'<br>

    What's happening to the $3?

  • Richard Bell

    #2
    Re: New ITX (HTML_Template_ ITX) user needs help!

    It turns out that $ is special within values in ITX and must be
    escaped with '\'.


    On 8 Dec 2004 11:57:43 -0800, "puff" <rbell01824@ear thlink.net> wrote:
    [color=blue]
    >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'>{URL 2}<br>
    ><!-- END SITES -->
    ></p>
    ></form>
    >
    >The relevant portion of the php setting the variables is:
    >
    >foreach($x as $k=>$v){
    >$tpl->setVariable('U RL1',str_replac e(' ','',$v));
    >$tpl->setVariable('U RL2',$v);
    >$tpl->parseCurrentBl ock();
    >}
    >
    >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'>'Fas t B Bank'<br>
    ><input type='checkbox' name='FastInter netOnlyBank' value='ON'>'Fas t
    >Internet Only Bank'<br>
    >
    >What's happening to the $3?[/color]

    Comment

    Working...