izan
New Member
سلام اساتید !
کسی لطف می کنه راهنماییم کنه مشکل این function کجاست که وقتی تو localhost اجرا می کنم چیزی نشون نمیده و صفحه سفیده !
با سعی و خطا فهمیدم که چون این صفحه رو میذارم تو function content_cats اینجوری میشه ، چطورمی تونم حل کنم موضوعو که این function و که call کردم این صفحه اجرا شه ؟
کسی لطف می کنه راهنماییم کنه مشکل این function کجاست که وقتی تو localhost اجرا می کنم چیزی نشون نمیده و صفحه سفیده !
با سعی و خطا فهمیدم که چون این صفحه رو میذارم تو function content_cats اینجوری میشه ، چطورمی تونم حل کنم موضوعو که این function و که call کردم این صفحه اجرا شه ؟
PHP:
<?php
session_start();
if (!isset($_SESSION['MM_Username']))
{header("Location:login.php?timeout");}
require_once('../Connections/cn.php');
//=============================================================CONTENT_CATEGORY MANEGEMENT FORM
function content_cats(){
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="fa">
<link rel="stylesheet" type="text/css" href="../myCSS.css">
<title>مدیریت دسته بندی موضوعی</title>
</head>
<body>
<?php //--------------------------------CONTENT----------------------------------------------------?>
<p align="center"> </p>
<div align="center">
<table border="1" width="500" id="table1" style="border-collapse: collapse" bordercolor="#808080" height="160">
<form method="POST" action="admin.php?go=add_cat&part=content">
<tr>
<td height="29" bordercolor="#666666" bgcolor="#666666">
<p align="center"><font face="Tahoma" size="2" color="#FFFFFF">مدیریت دسته بندی موضوعی</font>
</td>
</tr>
<tr>
<td>
<table border="0" width="100%" id="table2" bgcolor="#CCCCCC">
<tr>
<td bgcolor="#339966" colspan="3">
<p align="center">
<font color="#00FF00" face="Tahoma" style="font-size: 9pt">
اضافه کردن گروه جدید<img border="0" src="../images/addedit.png" width="18" height="18"></font></td>
</tr>
<tr>
<td height="28" bgcolor="#5FC994">
<p align="center"><font face="Tahoma">
<span style="font-size: 9pt">
<input type="submit" value="اضافه کن" name="B1"></span></font></td>
<td width="182" height="28" bgcolor="#5FC994">
<font face="Tahoma"><span style="font-size: 9pt">
<input type="text" name="name" size="20" dir="rtl"></span></font></td>
<td width="148" height="28" bgcolor="#5FC994">
<p align="center" dir="rtl">
<font face="Tahoma" style="font-size: 9pt">نام گروه جدید :</font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" width="100%" id="table3" bgcolor="#CCCCCC">
<tr>
<td bgcolor="#AAAAFF" colspan="4">
<p align="center" dir="ltr">
<font face="Tahoma" size="2" color="#0000FF">گروه های موجود
<img border="0" src="../images/CheckMark.gif" width="16" height="16">
</font>
</td>
</tr>
<tr>
<td align="center" height="22" bgcolor="#AAAAFF" width="17%">
<font face="Tahoma" style="font-size: 9pt" color="#0000FF">حذف</font>
</td>
<td align="center" height="22" bgcolor="#AAAAFF" width="23%">
<font face="Tahoma" style="font-size: 9pt" color="#0000FF">ویرایش</font>
</td>
<td width="47%" align="center" height="22" bgcolor="#AAAAFF">
<font face="Tahoma" style="font-size: 9pt" color="#0000FF">نام گروه</font>
</td>
<td align="center" height="22" bgcolor="#AAAAFF" width="11%">
<font face="Tahoma" style="font-size: 9pt" color="#0000FF">ردیف</font>
</td>
</tr>
<?php
mysql_select_db($database_cn, $cn);
$query="SELECT * FROM `categories` WHERE `part` LIKE 'content' ORDER BY cid ASC";
if(! $sql = mysql_query( $query )){echo " error in cat : ";print mysql_error();}
$counter=0;
$num=mysql_num_rows($sql);
for($i=0;$i<$num;$i++)
{
$counter++;
$R=mysql_fetch_array($sql);
$cid=$R['cid'];
$name=$R['name'];
$part=$R['part'];
?>
<tr>
<td bgcolor="#D5D5FF" align="center" width="17%">
<font face="Tahoma" style="font-size: 9pt">
<?php
echo"<a href=\"admin.php?go=del_cat&back=content_cats&cid=$cid\"
onclick=\"if(confirm('.توجه: تمام اخبار موجود در اين گروه نيز حذف خواهد شد'))
return true;else return false;\">";
?>
<font color="#800000">
<img border="0" src="../images/icon_delete.png" width="12" height="12">
</font></a></font>
</td>
<td bgcolor="#D5D5FF" align="center" width="23%">
<font face="Tahoma" style="font-size: 9pt">
<a href="admin.php?go=edit_cat&back=content_cats&cid=<?php echo"$cid&old=$name";?>">
<font color="#800000">
<img border="0" src="../images/edit_f2.png" width="20" height="20">
</font>
</a></font></td>
<td width="47%" bgcolor="#D5D5FF" align="right">
<p align="right">
<span lang="en-us">
<font face="Tahoma" style="font-size: 9pt" color="#800000">
<?php echo $name?></font></span></td>
<td bgcolor="#D5D5FF" align="center" width="11%">
<p align="center"><span lang="en-us">
<font face="Tahoma" style="font-size: 9pt" color="#800000">
<?php echo $counter?></font></span></td>
</tr>
<?php }?>
</table>
</td>
</tr>
</form>
</table>
</div>
<p> </p>
</body>
</html>
<?php //------------------------------------ content_cats------------------------------------------------?>
<?php }?>