WordPress.org

Ready to get started?Download WordPress

Forums

help with funky backslash problem (5 posts)

  1. dmd54
    Member
    Posted 1 year 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:

    <tr>
    			<th><label for="blurb5_enable">Display Fourth Homepage Blurb (Testimonials Quote)</label></th>
    			<td>
    				<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>
    			</td>
    		</tr>
    		<tr valign="top">
    			<th scope="row"><label for="blurb5_text">Blurb Text</label></th>
    			<td>
    				<textarea name="blurb5_text" id="blurb5_text" rows="3" cols="70" style="font-size:11px;"><?php echo stripslashes(get_option('boldy_blurb5_text')); ?></textarea>
    			</td>
    		</tr>

    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">
    			<p>
    				<?php
    			if(get_option('boldy_blurb5_page')!=""){
    				echo get_permalink(get_option('boldy_blurb5_page'));
    				}elseif(get_option('boldy_blurb5_link')!=""){
    				echo get_option('boldy_blurb5_link');
    			} ?>
    
    			<?php echo get_option('boldy_blurb5_text'); ?>
    			</p>
    		</div><!--END OF INNER BLURB5 -->
    	   </div><!-- END OF BLURB5 -->
    
    	   <?php }?><!-- END FIFTH BLURB -->

    Any suggestions??

  2. Krishna
    Volunteer Moderator
    Posted 1 year ago #

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

  3. michael.mariart
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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