Echo value

Discussion in 'PHP' started by pioneer1, Sep 4, 2009.

  1. #1
    How can I echo the total value in id="txtTotal" to a variable $products_price on form?

    Basically id="txtTotal" value must be same for $products_price.

    Its on Oscommerce product_info page

    
    Total:
    <input type="text" id="txtTotal" size="8" /> 
    <?php echo $products_price; ?>
    </p> 
    </form> 
    
    
    Code (markup):
    Any help will be appreciated

    Thanks
     
    pioneer1, Sep 4, 2009 IP
  2. prasanthmj

    prasanthmj Member

    Messages:
    62
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    45
    #2
    Is this what you want?
    
    <input type="text" id="txtTotal" size="8"  value="<?php echo $products_price; ?>"/> 
    </p> 
    </form>
    
    Code (markup):
     
    prasanthmj, Sep 4, 2009 IP
  3. yuvrajm

    yuvrajm Peon

    Messages:
    52
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    
    <?
    echo "<input type=\"text\" value=\"".$products_price."\" id=\"txtTotal\" size=\"8\" />"; 
    ?>
    
    Code (markup):
    Just another method
     
    yuvrajm, Sep 4, 2009 IP
  4. Martinoes

    Martinoes Peon

    Messages:
    110
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    
    <input type="text" id="<?php echo $products_price; ?>" size="8" /> 
    
    PHP:
    or

    
    <?php 
     echo '<input type="text" id="'.$products_price.'" size="8" />';
    ?>
    
    PHP:
     
    Martinoes, Sep 5, 2009 IP