j'ai écrit le code javascipt suivant mais je ne sais comment je veux introduire le php dans ce code quand je l'éxecute il n'affiche rien .Le javascript pour notifier l'utilisateur des nouveaux sujets et je les cherche à partir du base de donnée
je veux écrire dans sNotify.addToQueue() des variables php qui sont un resultat d'une requette MySQLCode:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.1.min.js"></script> <script src="f_clone_Notify.js" type="text/javascript"></script> <link href="f_clone_Notify.css" rel="stylesheet" /> </head> <body> <script type='text/javascript'> sNotify.addToQueue('This is for notification message'); sNotify.alterNotifications('chat_msg'); </script> </body> </html>
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 <?php session_start(); include("debut.php"); include("identifiants.php"); $id=(isset($_SESSION['id']))?$_SESSION['id']:0; $query=<<<toto SELECT membre_pseudo, forum_name FROM forum_topic_view, forum_forum_cour, member_cour, forum_members WHERE forum_topic_view.tv_forum_id = member_cour.idcour AND forum_forum_cour.forum_id = member_cour.idcour AND member_cour.membre_id <>$id AND member_cour.membre_id = forum_members.membre_id; toto; $res=mysql_query($query); if(mysql_num_rows($res)==0) echo "Il n'ya pas des nouveaux sujets"; else while($ligne=mysql_fetch_assoc($res)) {echo $ligne['membre_pseudo'] ."a poste dans". $ligne['forum_name'];//cette ligne je veux la mettre dans sNotify.addToQueue surement dans une boucle }