mmarif4u Posted March 8, 2007 Share Posted March 8, 2007 Hi guys. In the below code u will see that i echo a variable, but i have no idea to hide that text from other package user. <tr align="left"><td <?php echo $disabled1?>><font color="red" class="txtbluev2_16"><br> To see your report card upto three(complete) levels,please contact us for details.</tr></td> Here is the condition: else{ $disabled1 = 'disabled="disabled"';} In the above variable i use disabled attribute but it does not hide the text. Q is the which attribute to use here to hide the text. Any help will be appreciated. Thanks. Link to comment https://forums.phpfreaks.com/topic/41717-solved-hide-some-text-from-user/ Share on other sites More sharing options...
skali Posted March 8, 2007 Share Posted March 8, 2007 You can use <div>, set its style attribute to <style="visibility:visible"> <style="visibility:hidden"> Link to comment https://forums.phpfreaks.com/topic/41717-solved-hide-some-text-from-user/#findComment-202269 Share on other sites More sharing options...
mmarif4u Posted March 8, 2007 Author Share Posted March 8, 2007 Thanks skali for reply. Yeh u r right i can use that. But the problem is that i have 3 packages for user, i use query for that to guess which user in accessing with which package.it means the condition is must. here is code: $query = "SELECT nrpackage FROM m_package where nrpackage='$session_nrpackage'"; $result = mysql_query($query) or die(mysql_error()); //$ic=$row->$session_nrpackage; if ($session_nrpackage == '1006') { $disabled = "javascript:void(null);"; }else{ $disabled1 = 'disabled="disabled"'; } this is where i echo disabled: <tr align="left"><td <?php echo $disabled1?>><font color="red" class="txtbluev2_16"><br> To see your report card upto three(complete) levels,please contact us for details.</tr></td> If <div> is applicable here then how to adjust it here. Link to comment https://forums.phpfreaks.com/topic/41717-solved-hide-some-text-from-user/#findComment-202282 Share on other sites More sharing options...
Guest footballkid4 Posted March 8, 2007 Share Posted March 8, 2007 Change: $query = "SELECT nrpackage FROM m_package where nrpackage='$session_nrpackage'"; $result = mysql_query($query) or die(mysql_error()); //$ic=$row->$session_nrpackage; if ($session_nrpackage == '1006') { $disabled = "javascript:void(null);"; }else{ $disabled1 = 'disabled="disabled"'; } To: $query = "SELECT nrpackage FROM m_package where nrpackage='" . $session_nrpackage . "'"; $result = mysql_query($query) or die(mysql_error()); //$ic=$row->$session_nrpackage; if ($session_nrpackage == '1006') { $disabled = "javascript:void(null);"; } else { $disabled1 = "style='display: none;'"; } However, you should be considering how practical this really is. Why would you do a display: none if you don't want the user to see it when you could just take it off of the page in general. This would work, and would hide the text from the user...but they could just view the source and see what it says. Link to comment https://forums.phpfreaks.com/topic/41717-solved-hide-some-text-from-user/#findComment-202283 Share on other sites More sharing options...
mmarif4u Posted March 8, 2007 Author Share Posted March 8, 2007 Thanks footballkid4 for help. its working now.Great Link to comment https://forums.phpfreaks.com/topic/41717-solved-hide-some-text-from-user/#findComment-202292 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.