我想将我的类中的函数中的全局变量转换为$ this->变量.这可能吗?这是我为班级编写的代码.
class tool
{
//If this is used remember to replace Void with $target
public function mute()
{
global $target;
mysql_query("UPDATE users SET mute='1' WHERE name='". $target ."'");
}
}
Run Code Online (Sandbox Code Playgroud) 我想在页面中淡出消息,然后淡出以显示用户登录登录的用户,然后重定向到配置文件,但消息刚出现在屏幕上没有淡入淡出,但它确实消失了很好.
这是我的代码:
echo "
<script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js\">
</script>
<script>
$(function() {
$('button').click(function() {
$('p').fadeIn(3000);
$('p').fadeOut(5000);
});
});
</script>";
$error = "<meta http-equiv='refresh' content='100; Me'>
<p style='font-weight:bold;color:green;padding:3px;'>Welcome back $name!</p>";
Run Code Online (Sandbox Code Playgroud)