Jump to content

[SOLVED] 2 basic questions . . .


itdmacar

Recommended Posts

HI,

 

1 ) How do I make my text smaller in my option value ? It using the standard size, is it possible to change the size text ?

 

            <option value="<?php echo $_SESSION['lnktown']; ?>"><?php echo $_SESSION['lnktown']; ?></option>

 

2) I have a header input field but whenever the text contains '  e.g. Ronald's, my script is failing due to that '

 

    I did tried to remove it by  dong this  $valheader = strip_tags(trim($value)); still failing

 

            how to convert from  Ronald's  to  Ronalds

 

Thanks in advance . . .

 

Link to comment
Share on other sites

1 ) How do I make my text smaller in my option value ? It using the standard size, is it possible to change the size text ?

 

Yes. You should use Cascading Style Sheets (CSS).

 

2) You shouldn't need to remove single quotes to make your code work, but if you want to remove single quotes, try

 

str_replace("'","",$value);

Link to comment
Share on other sites

2) U can use str_replace() as suggested to completely remove the ', but also u can consider adding and stripping slashes:

 

<?php
$name = "Ronald's";
$name = addslashes($name);
echo $name; //will output: Ronald\'s
?>

 

In this way ull not have problems with database queries and stuff. To strip those slashes and return the string to original u use stripslashes():

 

echo stripslashes($name); //will produce: Ronald's

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.