help with funky backslash problem (5 posts)

  1. dmd54
    Posted 2 years ago #

    Ok...at the bottom of this site http://manymutts.com in the client testimonial area you will see that there are backslashes appearing before the quotes. I can't seem to understand what is causing that.

    That area of text is controlled by a theme function page. That section is as follows to have a editable content area:

    			<th><label for="blurb5_enable">Display Fourth Homepage Blurb (Testimonials Quote)</label></th>
    				<select name="blurb5_enable" id="blurb5_enable">
    					<option value="yes" <?php if(get_option('boldy_blurb5_enable') == 'yes'){?>selected="selected"<?php }?>>Yes</option>
    					<option value="no" <?php if(get_option('boldy_blurb5_enable') == 'no'){?>selected="selected"<?php }?>>No</option>
    				</select><br />
                    <em>If "Yes" is selected and text field is empty, the blurb wont appear</em>
    		<tr valign="top">
    			<th scope="row"><label for="blurb5_text">Blurb Text</label></th>
    				<textarea name="blurb5_text" id="blurb5_text" rows="3" cols="70" style="font-size:11px;"><?php echo stripslashes(get_option('boldy_blurb5_text')); ?></textarea>

    The home page that receives the input is as follows:

    <?php if(get_option('boldy_blurb5_enable')=="yes" && get_option('boldy_blurb5_text')!=""){ ?>
    	   <div id="blurb5">
    		<div id="innerBlurb5">
    				echo get_permalink(get_option('boldy_blurb5_page'));
    				echo get_option('boldy_blurb5_link');
    			} ?>
    			<?php echo get_option('boldy_blurb5_text'); ?>
    		</div><!--END OF INNER BLURB5 -->
    	   </div><!-- END OF BLURB5 -->
    	   <?php }?><!-- END FIFTH BLURB -->

    Any suggestions??

  2. Krishna
    Volunteer Moderator
    Posted 2 years ago #

    I don't see anything as you say. Clear cache and check again.

  3. michael.mariart
    Posted 2 years ago #

    That's standard PHP escaping for database values. What you need ot do is use strip_slashes() to remove the slashes.

    echo strip_slashes (get_option('boldy_blurb5_link'));

  4. dmd54
    Posted 2 years ago #

    Yeah, I'm still relatively new to PHP but the only documentation I found was from 2009.

    Are you sure it's strip_slashes and not stripslahes?

  5. dmd54
    Posted 2 years ago #

    Cool...appears to work with stripslashes, the underscore returned a fatal error.

    thanks for the help.

Topic Closed

This topic has been closed to new replies.

About this Topic