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 . . . Link to comment https://forums.phpfreaks.com/topic/70218-solved-2-basic-questions/ 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); Link to comment https://forums.phpfreaks.com/topic/70218-solved-2-basic-questions/#findComment-352688 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 Link to comment https://forums.phpfreaks.com/topic/70218-solved-2-basic-questions/#findComment-352724 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 . . . Link to comment https://forums.phpfreaks.com/topic/70218-solved-2-basic-questions/#findComment-352912 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! Link to comment https://forums.phpfreaks.com/topic/70218-solved-2-basic-questions/#findComment-352937 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); ?> Link to comment https://forums.phpfreaks.com/topic/70218-solved-2-basic-questions/#findComment-352950 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. Link to comment https://forums.phpfreaks.com/topic/70218-solved-2-basic-questions/#findComment-352980 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); ?> Link to comment https://forums.phpfreaks.com/topic/70218-solved-2-basic-questions/#findComment-352991 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.