شكرا لك اخي العزيز
اولا
انا عندي ملف باسم newsedit.php و ملف باسم edit.php
محتويات newsedit.php
اولا
<?
include"../reng.php";
$sql="select*from second WHERE secondID='$_GET[secondID]'";
$res=mysql_query($sql) or die(mysql_error());
while($row=mysql_fetch_array($res)){
$secondID=$_GET['secondID'];
?>وثانيا ادخال الحقول منها اختيار اللغة و الاقسام الرئيسية
<? echo" <p dir='rtl'> <form method=POST action='edit.php?secondID=$row[secondID]' dir=ltr> <table border=1 width=622 id=table1 align=center cellspacing=0 cellpadding=0 bordercolorlight=#CCCCFF bordercolordark=#CCCCFF style=\"border-collapse: collapse\"> <tr> <td width='500' align='right'> <p dir='ltr'> <select size=1 name=lang style=\"font-family: Tahoma\"> <option value=2>عربی</option> <option value=3>ئینگلیزی</option> </select> <td width=120 height=33 align=right> <p align=center>اللغة</td> </tr> <tr> <p align='center'> <td width='500' height='33' align='right'> <select size=\"1\" name=\"cat\" style=\"font-family: Tahoma\"> <option value=\"العلمي\">العلمي</option> <option value=\"السياسي\">السياسي</option> </select> <td width=\"120\" height=\"33\" align=\"right\"> <p align=\"center\">الاقسام الرئيسية</td> </tr>"; ?> <? echo" <tr> <td width='500' height=33 align='right'> <p dir='ltr'><input name='subject' style=\"font-family: tahoma\" dir=rtl value='$row[subject]' size='75'></td> <td width=120 height=33 align=right> <p dir=rtl align=center>عنوان الاخبار</td> </tr> <tr> <td width='500' height=33 align='right'> <p dir='ltr'><input name='imgurl' style=\"font-family: tahoma\" dir=rtl value='$row[imgurl]' size='75'></td> <td width=120 height=33 align=right> <p dir=rtl align=center>رسم</td> </tr>
و ايضا كود ادخال الاقسام الفرعي ل كومبو بوكس
<?
echo "<select name=subcat[]>
";
include"../config.php";
$query="SELECT subcat, firstID FROM first ";
$result=mysql_query($query) or die;
while ($row=mysql_fetch_assoc($result))
{
echo "
<option value=$row[firstID]>$row[subcat]</option>
";
}
echo "</select>";
?>هذه المحتويات هذا الملف
و محتويات الملف edit.php بهذا الشكل
<?
include "../config.php";
$secondID=$_GET['secondID'];
$cat_id = $_GET['subcat'][0];
if (!get_magic_quotes_gpc()) {
array_map("addslashes",$_POST);
}
$lang =addslashes($_GET['lang']);
$subject = addslashes($_GET['subject']);
$detials = addslashes($_GET['detials']);
$cat = addslashes($_GET['cat']);
$imgurl = addslashes($_GET['imgurl']);
$firstID = addslashes($_GET['firstID']);
$sql="UPDATE second SET firstID='$_POST[cat_id], lang='$_POST[lang]',cat='$_POST[cat]',imgurl='$_POST[imgurl]',subject='$_POST[subject]', detials='$_POST[detials]' WHERE secondID='$secondID'";
$res=mysql_query($sql) or die(mysql_error());
if($res){
echo"yes";
echo "<meta http-equiv=\"Refresh\" content=\"0;url=index.php\">";
}
else{
echo"no";
}
?>انا حاولت كثرا لكن لم انجح في تعديل
انا اريد في هذه الحالة تعديل الاخبار في جدول second
ارجوا فیها توضيح
مع حبي لكم
