Jump to content

[SOLVED] Hide some text from user


mmarif4u

Recommended Posts

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

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.

 

 

Guest footballkid4

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.