itdmacar Posted September 21, 2007 Share Posted September 21, 2007 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 . . . Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted September 21, 2007 Share Posted September 21, 2007 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); Quote Link to comment Share on other sites More sharing options...
Fadion Posted September 22, 2007 Share Posted September 22, 2007 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 Quote Link to comment Share on other sites More sharing options...
itdmacar Posted September 22, 2007 Author Share Posted September 22, 2007 BlueSkyIS and GuiltyGear, Thank you very much for your help, I am gonno try those suggestions . . . Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 22, 2007 Share Posted September 22, 2007 use mysql_real_escape_string if you are using MySQL, not addslashes! Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted September 22, 2007 Share Posted September 22, 2007 <?php $name = "Ronald's"; $name = stripslashes($name); $name=mysql_real_escape_string($name); ?> Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted September 22, 2007 Share Posted September 22, 2007 why stripslashes when there are none? Forget stripslashes. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted September 22, 2007 Share Posted September 22, 2007 haha yeah sorry guess i didnt bother to read the original post i didnt see someone added in addslashes. <?php $name = "Ronald's"; $name=mysql_real_escape_string($name); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.