Results 1 to 2 of 2

Thread: Combo Box Selections Problem

  1. #1

    Question Combo Box Selections Problem

    I have a combo box that lets the user select his height.

    Code:
                            
    <select id="PersonHeight" name="PersonHeight" style="height: 24px;">
    <option value="" selected="selected"> </option>
    <option value="4'">4'</option>
    <option value="4' 1"">4' 1"</option>
    <option value="4' 2"">4' 2"</option
    
    etc.
    For example, he can select 4' (i.e. four feet).

    But when I retrieve the data via the $_POST variable I don't get 4'. Instead, it comes out as 4\'. That is, it's somehow inserting a backslash before the single quote, even though there's no single quote specified for either the value or the text of the option. The same thing happens with the double-quote (i.e. "foot") mark.

    Why does this happen? Is there a way to tell it to NOT do this, and to simply return the actual value (without the backslashes)?

  2. #2
    Senior Member chuckj's Avatar
    Join Date
    Jan 2010
    Location
    www.beyondfusion.com - Florida
    Posts
    1,302

    Default

    What scripting language are you using? PHP?

    This is normal behavior on most servers when you have a special character (single and double quotes qualify) in a value.

    MagicQuotes is turned on.

    You can remove the slashes using the cleverly named stripslashes function.

    http://php.net/manual/en/function.stripslashes.php
    Chuck Joslin
    www.BeyondFusion.com
    PHP & MySQL development with Fusion
    Fusion support for AllWebMenus (Likno) Contact me for custom AWM menus for your sites.
    Tutorials and Forums

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •