ציטוט:
נכתב במקור על ידי tnadav
אתה משתמש בקידוד UTF-8?
|
כן
PHP קוד:
<?php
// Copyright © Hanan. All rights reserved.
ob_start();
require('configure.php');
require('header.php');
if ((isset($_SESSION['id'])) && (isset($_SESSION['user'])) && (isset($_SESSION['pass']))) {
switch ($_GET['a']) {
case "logout":
session_destroy();
?>
<meta http-equiv="Refresh" content="0; URL=index.php">
<?php
break;
case ".$a.update":
$id1= $a;
$text = $_POST['text'];
$headline = $_POST['headline'];
if ($_POST['text'] && $_POST['headline']) {
mysql_query("DELETE FROM `nihul` WHERE `id`='.$a.'") or die (mysql_error());
$add1 = "INSERT INTO nihul (id, text, headline) VALUES ('$id1', '$text','$headline')";
///////mysql_query("UPDATE 'nihul' WHERE `id`='1' SET headline='".$_POST['headling']."',text='".$_POST['text']."'") or die (mysql_error());
mysql_query($add1);
?>
השינויים עודכנו בהצלחה. הנך מועבר<br>
אם אינך מועבר בתוך מספר שניות, אנא לחץ <a href="<?= $_SERVER['PHP_SELF']; ?>?a=.$a."><b>כאן</b></a>
<meta http-equiv="Refresh" content="2; URL=<?= $_SERVER['PHP_SELF']; ?>$=.$a.">
<?php
} else {
echo "<b>אנא חזור אחורה ומלא את כל הפרטים, תודה</b>";
}
break;
case ".$a.":
$n31 = mysql_query("SELECT * FROM `nihul` WHERE `id`='.$a.'") or die(mysql_error());
$n1 = mysql_fetch_array($n31);
?>
<form action="<?= $_SERVER['PHP_SELF']; ?>?a=.$a.update" method="POST">
<table cellspacing="0" cellpadding="0" style="border: 0px solid #00009C;" width="95%" align="center">
<tr>
<td background="images/menu_00.jpg" align="center" height="20"><font color="FFFFFF"><b>עדכון פרטים</b></font></td>
</tr></table>
<table cellspacing="1" cellpadding="0" style="border: 1px solid #00009C;" width="95%" align="center">
<tr>
<td align="right" width="80%"><input type="text" dir="rtl" name="headline" value="<?= $n1['headline']; ?>" style="width: 500pxpx;"></td>
<td align="right" dir="rtl" width="20%"><b><u>כותרת</b></u></td>
</tr>
<tr>
<td align="right" width="80%"><TEXTAREA NAME="text" onkeypress="return isNumberKey(event)" style="width: 500px; height: 350px;" /><? echo "$n1[text]"; ?></TEXTAREA></td>
<td align="right" dir="rtl" width="20%"><b><u>תוכן</b></u></td>
</tr>
</table>
<br>
<input type="submit" name="send" value="עדכן">
</form>
<?php
break;
}
mysql_close($connation);
} else {
header("Location: index.php");
ob_end_flush();
}
// Copyright © Prozit. All rights reserved.
?>
טוב אז עשיתי עם הOB
וזה כותב את השגיאה הבאה:
קוד:
Warning: Cannot modify header information - headers already sent by (output started at /home/labdan/domains/prozit.net/public_html/root/nihul.php:1) in /home/labdan/domains/prozit.net/public_html/root/nihul.php on line 67
(זאת השורה:
header("Location: index.php");
)