سلام عليكم من الله ورحمته وبركاته ...
أعزائي ....
تواجهني مشكلة ما في كود قمت ببرمجته ..... ولم أعرف أين مكمن الخطأ ...
والخطا الذي يواجهني هو عدم ظهور رسالة الألرت عند عمل الصفحة ...... وللتأكد قمت بوضع جملة طباعة داخل السكريبت ولم تعمل .....
ومن ثم حاولت وضع نفس الأمر خاترج السكريبت ونفذت جملة الطباعة .....إذاااا الخطأ هو أن السكريبت لايعمل ....
برأيكم أين الخطأ .....
؟؟
____
<script type = "text/javascript">
<?php
include ("connect.php");
$s = ("SELECT message FROM messages WHERE to_viewed = '0' ");
//you can remove the trigger_error() call on the live server
//and place an @ before mysql_query to stifle errors from being displayed
$q = mysql_query($s) or trigger_error(mysql_error());
//you can take this comment and the next line out, just testing for result
echo '<p>Rows: '.mysql_num_rows($q).'</p>';
if(mysql_num_rows($q) > 0) {
require('pm.php');
?>
var answer = confirm("you have a new message");
if(answer) {
window.location = "http://www.google.com.sa/"
} else {
//whatever action if no action, you don't need the else
}
<?php } ?>
</script>شاكرة لكم وقفتكم معي ...