Avi Salama |
26-08-08 15:54 |
בעיה כלשהי בפונקצייתFOPEN
שלום לכולם, יש לי את הבא שעורך חלק כלשהו באתר שלי והבעיה היא שמה שאני כותב בעריכת תוכן של העמוד 'אודות' הוא כותב אותו דבר גם בתיבת טקסט של ה TITLE וזה אמור להיות שכל טקסט יהיה שונה אחד מהשני.. מה הבעיה פה בקוד?
PHP קוד:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="rtl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255" />
<link rel="stylesheet" type="text/css" href="style.css" />
<title>מערכת ניהול תוכן</title>
</head>
<body>
<div align="center">
<form name="update" method="post" action="">
<br />
<b>עריכת עמוד 'אודות':</b>
<br />
<?php
// -- DO NOT TOUCH THIS!! THIS PART UPDATING TEXT.PHP
if (isset($_POST['submit'])) {
$file = "text.php";
$open = fopen($file, 'w');
fwrite($open, " ".$_POST['update']."\r\n");
fclose($open);
}
?>
<textarea cols="70" rows="15" name="update">
<?php
include('text.php');
?>
</textarea>
<br />
<input type="submit" name="submit" value="עדכן דף > >" />
</form>
<br />
<form name="update2" method="post" action="">
<br />
<b>עריכת כותרת 'Title':</b>
<br />
<?php
// -- DO NOT TOUCH THIS!! THIS PART UPDATING TITLE.PHP
if (isset($_POST['submit'])) {
$file = "title.php";
$open = fopen($file, 'w');
fwrite($open, " ".$_POST['update2']."\r\n");
fclose($open);
}
?>
<textarea cols="23" rows="2" name="update2">
<?php
include('title.php');
?>
</textarea>
<br />
<input type="submit" name="submit" value="עדכן כותרת > >" />
</form>
תודה רבה (:
|