Loading ...
Sorry, an error occurred while loading the content.

special character " to be displayed in html page

Expand Messages
  • pannet1
    Dear I need to display a html list box with the following values .. 4 2 (1.60 mts) 4 5
    Message 1 of 3 , May 29 4:52 AM
    • 0 Attachment
      Dear

      I need to display a html list box with the following values

      ..
      <Select name="height">
      <option value=1>4' 2" (1.60 mts)</option>
      <option value=1>4' 5" (1.70 mts)</option>
      </Select>
      ...

      I am using php to display the selected value upon submit and
      revisiting of the page.

      <?php

      /*stuffing of option values into php array aHeight
      by using html special characters */


      $aHeight[1] = "4' 2" (1.60mts)";
      $aHeight[2] = "4' 5" (1.70mts)";


      ' trying to display special characters
      ' by mixing up :-( of php and html looks like this.


      $i = 1
      while ($i <= 3) {

      ' $height is from db with two

      !strcmp($i,$height) ? $sSelected="selected" : $sSelected ="";
      print "<option value=\"." $i"\"".$sSelected."
      clean($aHeight[$i])."</option>"
      ++$i;
      }
      ?>

      code ends here
      --


      Instead of displaying the required html the output html has prints the
      special characters (") without converting them to " like this

      <!-- html listbox -->
      4' 2" (1.60mts)
      4' 5" (1.70mts)

      Hope I have not confused you all.

      Best Regards
      B Karthick
    • Vinu Thomas
      ... Changing the lines above to : $aHeight[1] = 4 2 (1.60mts) ; $aHeight[2] = 4 5 (1.70mts) ; should solve your problem and generate the following
      Message 2 of 3 , May 29 5:09 AM
      • 0 Attachment
        --- "pannet1" <pannet1@...> wrote:

        > I need to display a html list box with the following values
        >
        > ..
        > <Select name="height">
        > <option value=1>4' 2" (1.60 mts)</option>
        > <option value=1>4' 5" (1.70 mts)</option>
        > </Select>
        > ...
        > $aHeight[1] = "4' 2" (1.60mts)";
        > $aHeight[2] = "4' 5" (1.70mts)";

        Changing the lines above to :

        $aHeight[1] = "4' 2\" (1.60mts)";
        $aHeight[2] = "4' 5\" (1.70mts)";

        should solve your problem and generate the following HTML:

        <option value="1">4' 2" (1.60mts)</option>
        <option value="2">4' 5" (1.70mts)</option>

        Hope that helps. :)

        Regards,
        Vinu
      • maq sood
        Hi pannet, Use html_entity_decode() or htmlspecialchars_decode() function check the manual for syntax.... Regards, Maqs pannet1 wrote:
        Message 3 of 3 , May 29 5:13 AM
        • 0 Attachment
          Hi pannet,
          Use html_entity_decode() or htmlspecialchars_decode() function check the manual for syntax....

          Regards,
          Maqs




          pannet1 <pannet1@...> wrote:
          Dear

          I need to display a html list box with the following values

          ..
          <Select name="height">
          <option value=1>4' 2" (1.60 mts)</option>
          <option value=1>4' 5" (1.70 mts)</option>
          </Select>
          ...

          I am using php to display the selected value upon submit and
          revisiting of the page.

          <?php

          /*stuffing of option values into php array aHeight
          by using html special characters */


          $aHeight[1] = "4' 2" (1.60mts)";
          $aHeight[2] = "4' 5" (1.70mts)";


          ' trying to display special characters
          ' by mixing up :-( of php and html looks like this.


          $i = 1
          while ($i <= 3) {

          ' $height is from db with two

          !strcmp($i,$height) ? $sSelected="selected" : $sSelected ="";
          print "<option value=\"." $i"\"".$sSelected."
          clean($aHeight[$i])."</option>"
          ++$i;
          }
          ?>

          code ends here
          --


          Instead of displaying the required html the output html has prints the
          special characters (") without converting them to " like this

          <!-- html listbox -->
          4' 2" (1.60mts)
          4' 5" (1.70mts)

          Hope I have not confused you all.

          Best Regards
          B Karthick









          ---------------------------------
          YAHOO! GROUPS LINKS


          Visit your group "bang-phpug" on the web.

          To unsubscribe from this group, send an email to:
          bang-phpug-unsubscribe@yahoogroups.com

          Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


          ---------------------------------





          ---------------------------------
          New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.

          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.