Hello guys, i’m new in this forum! I wanted to give a chance to drop a class and cookies to ensure it stays removed for the time that I have established.
Then, the cookie management I already know how to do it, to eliminate the class in PHP do not know, so I decided to use the API .fadeOut () to jQuery, so I gave a nice effect to the elimination (which hide rather than delete it, but let’s go). I wrote the code in this way, but it gives me problems (after I write the code that gives me problems):
[code=php]<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<style>
p { font-size:150%; cursor:pointer; }
</style>
<script src=”http://code.jquery.com/jquery-latest.js”></script>
</head>
<body>
<?php
$chiudi = “<script language=javascript>$(“p”).click(function () {
$(“p”).fadeOut(“slow”);
});</script>”;
setcookie(“chiudi_avviso”, $chiudi, time()+3600);
$cookie = $_COOKIE[‘nome_utente’];
if (!$cookie) {
echo “<p>Clicca qui</p>”;
}
?>
</body>
</html>
So, not only when I click the javascript function does not appear (obviously I used the system creates an incompatibility) but if I update the text you see the same so the cookie does not start, then .. What is wrong?
I’m sorry for my bad english, i’m italian!