הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   בעיה כלשהי בפונקצייתFOPEN (https://hosts.co.il/forums/showthread.php?t=66766)

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>


תודה רבה (:


Gal Shafrir 26-08-08 16:30

תנסה לקרוא למשל למשתנים של הtitle בצורה שונה למשל במקום file שיהיה file_title וכו'
אני מניח שזו הבעיה...

Avi Salama 26-08-08 19:06

כשלוחצים על עדכן: הוא עושה את השגיאות הבאות


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>Zvaim :: CMS</title>
</head>
<body>

            <div class="wrep">
                <div id="header">
                      <img src="images/bar.png" width="900" height="130" alt="" />

                <div id="menu">    
                          <div class="menu_text">
                          <a href="index.html">דף ראשי</a>
                                                                                                            <br />
                                                                                                            <a href="edit.php">עריכת דפים</a>
                                                                                                            <br />
                                                                                                            <a href="edit.php">עריכת חבילות</a>
                          </div>
                </div>
            </div>

                                                                       <div id="tail_right">
                        <div class="title_text" style="margin-right: -22px;">
                                                                                                            <?php
// -- DO NOT TOUCH THIS!! THIS PART UPDATING TITLE.PHP
if (isset($_POST['submit'])) {
$file "title.php";
$open fopen($file'w');
fwrite($open" ".$_POST['title']."\r\n");
fclose($open);


$file "text.php";
$open fopen($file'w');
fwrite($open" ".$_POST['text']."\r\n");
fclose($open);
}
?>

<script type="text/javascript" src="/zvaimnew/fckeditor/fckeditor.js"></script>
    <script type="text/javascript">

window.onload = function()
{
    // Automatically calculates the editor base path based on the _samples directory.
    // This is usefull only for these samples. A real application should use something like this:
     BasePath = '/zvaimnew/fckeditor/' ;    // '/fckeditor/' is the default value.


    var oFCKeditorText = new FCKeditor( 'text' ) ;
    oFCKeditorText.BasePath = BasePath;
    oFCKeditorText.Width = "573";
    oFCKeditorText.Height = "300";
    oFCKeditorText.ReplaceTextarea() ;

    /*var oFCKeditorTitle = new FCKeditor( 'title' ) ;
    oFCKeditorTitle.BasePath = BasePath;
    oFCKeditorTitle.ReplaceTextarea() ;*/
}

    </script>
</head>
<body>

<form name="update" method="post" action="">
<br />
<b>עריכת עמוד 'אודות':</b>
<br />
<textarea cols="70" rows="15" name="text">
<?php
echo htmlspecialchars(file_get_contents("text.php"));
?>
</textarea>
<br />
<input type="submit" name="submit" value="עדכן דף > >" />


<br />


<br />
<b>עריכת כותרת 'Title':</b>
<br />
<textarea cols="23" rows="2" name="title">
<?php
echo htmlspecialchars(file_get_contents("title.php"));
?>
</textarea>
<br />
<input type="submit" name="submit" value="עדכן כותרת > >" />
</form>

                                                                                </div>
                                                                       </div>

           </div>

</body>
</html>


PHP קוד:

Warningfopen(title.php) [function.fopen]: failed to open streamPermission denied in /home/zvaim/domains/zvaim.co.il/public_html/zvaimnew/zvaimcms/edit.php on line 31

Warning
fwrite(): supplied argument is not a valid stream resource in /home/zvaim/domains/zvaim.co.il/public_html/zvaimnew/zvaimcms/edit.php on line 32

Warning
fclose(): supplied argument is not a valid stream resource in /home/zvaim/domains/zvaim.co.il/public_html/zvaimnew/zvaimcms/edit.php on line 33

Warning
fopen(text.php) [function.fopen]: failed to open streamPermission denied in /home/zvaim/domains/zvaim.co.il/public_html/zvaimnew/zvaimcms/edit.php on line 37

Warning
fwrite(): supplied argument is not a valid stream resource in /home/zvaim/domains/zvaim.co.il/public_html/zvaimnew/zvaimcms/edit.php on line 38

Warning
fclose(): supplied argument is not a valid stream resource in /home/zvaim/domains/zvaim.co.il/public_html/zvaimnew/zvaimcms/edit.php on line 39 



כל הזמנים הם GMT +2. הזמן כעת הוא 17:49.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ