View Single Post
ישן 06-03-07, 18:05   # 3
Gold-System
Permanently Banned
 
מיני פרופיל
תאריך הצטרפות: Mar 2007
הודעות: 401

Gold-System לא מחובר  

PHP קוד:
<?=$leftarrow?> <a href='?sec=config&op=editindex'>עריכת עמוד ראשי</a>
<hr>
<?
include 'files/tinymcescript.php';


if(
$_SESSION['admin']=="admin"){



$result mysql_query("SELECT *  FROM config WHERE `id` = '1'");

$r=mysql_fetch_array($result);
$indextext=$r['welcome'];



echo 
"
<form method='post' action='?sec=config&op=editindex&do=edit'>

<table width='100%'>
  <tr>
    <td>
    <textarea name='elm2' style='width:500;height:300'>$indextext</textarea></td>
  </tr>
  <tr>
    <td width='100%'><INPUT type=submit value=שלח></td>
  </tr>
</table>

"
;

if (
$_GET['do']=="edit") {

$text $_POST['elm2'];



$sql "UPDATE `config` SET `welcome` = '$text' WHERE `id` = 1;";
$result mysql_query($sql) or die("Failed: $sql - ".mysql_error());

echo 

<br><br>
<b>התוכן עודכן בהצלחה</b>
<br>
אנא המתן, אתה מועבר...

<META HTTP-EQUIV=Refresh CONTENT='2; URL=admin.php'>
"
;

}

}

else if (
$_SESSION['admin'] != "admin") { 
echo
"
<br><br><br>
<b>
אין לך הרשאה להכנס לדף זה
</b>

"
; }

else { echo 
"<META HTTP-EQUIV=Refresh CONTENT='0; URL=?error=3'>"; }

?>
זה הקוד,
מה עושים?