Support » Themes and Templates » Stripslashes in textarea vs. text

  • OK, I’ve pretty much wrapped up my theme options menu. Its all working pretty sweet except for one thing I just can’t figure out. Stripslashes works in textarea, but not text. I’ll post the relevant (I think) sections of code….. am I missing some understanding? Right now, anywhere I want users to be able to add code, I use a textarea, but really I don’t need a giant textarea for users to add one line of code (like for google webmaster verification). As a note, I do use stripslashes in the theme call too…..

    <?php break;   
    
    case 'text':
    ?>   
    
    <div class="rm_input rm_text">
        <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
        <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_settings( $value['id'] ) != "") { echo stripslashes(get_settings( $value['id'])  ); } else { echo $value['std']; } ?>" />
     <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>   
    
     </div>
    <?php
    break;   
    
    case 'textarea':
    ?>   
    
    <div class="rm_input rm_textarea">
        <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
        <textarea name="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" cols="" rows=""><?php if ( get_settings( $value['id'] ) != "") { echo stripslashes(get_settings( $value['id']) ); } else { echo $value['std']; } ?></textarea>
     <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>   
    
     </div>

    It’s a problem mainly, that when users enter the code into the ‘text’ box and hit save on the options menu, everything gets all messed up immediately in the admin options menu

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Stripslashes in textarea vs. text’ is closed to new replies.