السلام عليكم
شكرا لكم جزيلا اخواني وبارك الله فيكم - نجحت بعمله بارك الله فيكم
للافادة اليكم الكود
كود PHP:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<title>ادارة الاخبار- اضافة خبر رئيسي </title>
</head>
<body topmargin="0">
<div align="center"><center>
<table cellpadding="0" cellspacing=01" border="0" width="95%" bgcolor="#000000">
<tr>
<td align="center" valign="top" width="100%" bgcolor="#FFFFFF">
<p align="center"><font face="Arial" size="3">
<?php
require("config.inc.php");
include("index.php");
$date=gmdate("d/m/Y");
?>
<center><font color=red>قائمة الاخبار الرئيسية </font></center><br>
<?
$step = 1;
$my_query1 = "SELECT id,subject FROM MyFastNews";
$query1 = mysql_query($my_query1);
$count = mysql_num_rows($query1);
if(empty($from)){
$from = 0;
$previous_link = "";
} else {
$previous_from = $from - $step;
if ($previous_from >= 0) {
$previous_link = "<a href=\"editnews.php?from=".$previous_from."\"><b>الصفحة السابقة</b></a>";
}
else {
$previous_link = "";
}
}
$next_from = $from + $step;
if ($next_from >= $count) {
$next_link = "";
} else {
$next_link = "<a href=\"editnews.php?from=".$next_from."\"><b>الصفحة التالية</b></a>";
}
$my_query2 = "SELECT id,subject FROM MyFastNews ORDER BY id DESC LIMIT ".$from.",".$step;
$query2=mysql_query($my_query2);
while($result=mysql_fetch_array($query2)){
$id = $result[id];
$head = $result[subject];
?>
<table style="width: 100%; text-align: left;" border="1" cellpadding="0" bordercolor="#333333"
cellspacing="0">
<tbody>
<tr>
<td style="width: 100px; text-align: center; vertical-align: top;"><a href="remove.php?news&id=<? echo $id ?>">حذف خبر</a><br>
</td>
<td style="width: 100px; text-align: center; vertical-align: top;"><a href="editnews1.php?news&id=<? echo $id ?>">تعديل الخبر</a><br>
</td>
<td style="vertical-align: top; text-align: right;"><?echo $head ?><br>
</td>
</tr>
</tbody>
</table>
<?
}
?>
<table style="width: 50%; text-align: left;" border="0" cellpadding="0" bordercolor="#333333"
cellspacing="0">
<tr><td width="50%" align="left"> <?=$previous_link?></td>
<td width="50%" align="right"><?=$next_link?> </td></tr>
</table>
</body>
</html>