£ sign not showing

Discussion in 'PHP' started by dougvcd, Mar 3, 2010.

  1. #1
    ok in my database i have 1 field with text etc and a £ sign eg dog biscuits £10.00 kg
    when displayed on the screen from a query dont get the £ sign just a small square
    any idea what the problem is
    cheers
    Doug
     
    dougvcd, Mar 3, 2010 IP
  2. Lever

    Lever Deep Thought

    Messages:
    1,823
    Likes Received:
    94
    Best Answers:
    0
    Trophy Points:
    145
    #2
    Try using the html encoding £ instead, see if that works.
     
    Lever, Mar 3, 2010 IP
  3. dougvcd

    dougvcd Peon

    Messages:
    267
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    cheers for that perfect
    Doug
     
    dougvcd, Mar 3, 2010 IP
  4. oxidati0n

    oxidati0n Peon

    Messages:
    744
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    What Lever said works, but to make it even better in your script put this - and it should do the exact same thing, but with everything on your pages.

    
    header("Content-type: text/html; charset=utf-8");
    
    Code (markup):
     
    oxidati0n, Mar 4, 2010 IP
  5. dougvcd

    dougvcd Peon

    Messages:
    267
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    ok that ok for main page but dosnt work in php
    
    ?>
            <h2>Online Order Form</h2>
            <h3>Just enter the Quantity you require</h3>
            <form action="formtoemailpro.php" method="post">
                <table width="676" border="0" cellspacing="5" style="background:#ececec">
    <thead>
                        <tr>
                            <th width="454">Product</th>
                          <th width="10">Qty</th>
          </tr>
                    </thead>
                    <tbody>
            
                            <?php while($product = mysql_fetch_assoc($result)): ?>
                            <tr>
                                <td>
                                    <?php echo $product['item'];?>                            </td>
                                <td>
                                    <?php $product_name = ($product['item']); ?>
                                <td width="146"><input type="text" name="orderline[<?php echo $product_name;?>]" /></td>
                      </tr>   
                            <?php endwhile; ?>
                    </tbody>
                </table>
    <table width="678" border="0" cellspacing="5" style="background:#ececec">
    <tr><td width="230"><strong>YOUR DETAILS</strong></td>
    </tr>
                            <tr><td>Name:  <span class="style1">required</span></td></tr>
                            <td><input type="text" size="30" name="name"></td></tr>
                            <tr><td>Email address:  <span class="style1">required</span></td></tr>
                            <td><input type="text" size="30" name="email"></td></tr>
                            <tr><td>Tel:  <span class="style1">required</span></td></tr>
                            <td><input type="text" size="15" name="tel"></td></tr>
                            <tr><td>Comments:<td width="429"><textarea name="com" cols="25" rows="6" id="com"></textarea></td></tr>
                            <tr><td>&nbsp;</td></tr>
                            <td><input type="submit" value="Send"><font face="arial" size="1">&nbsp;&nbsp;</font></td></tr>
                </table>
        </form>
    
    PHP:
    or does it need to be put in the above code
    cheers
    Doug
     
    Last edited: Mar 5, 2010
    dougvcd, Mar 5, 2010 IP
  6. chriseccles2

    chriseccles2 Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    If your charset is Unicode (utf-8), as per advice given, best to use &#163 for the UKpound sign.
    Some old browsers (yes, there are people still using Netscape and IE5Mac !) may not like &pound.

    Chris
     
    chriseccles2, Mar 7, 2010 IP
  7. Andrew E.

    Andrew E. Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Why not store the price in a different row as the name. Make it a float/double type, and just hard-code the pound sign into your page. Why store more info than you need to?
     
    Andrew E., Mar 8, 2010 IP