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

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

possible 10-03-08 19:24

עזרה|בעיה בקוד
 
טוב אז הכנתי קוד שמעדכן משהו במסד נתונים ומשום מה הוא כל הזמן מציג לי שגיאה
הינה הקוד:
PHP קוד:

<?php
include_once("fckeditor/fckeditor.php") ;

include 
"connect.php";
$id intval($_GET['id']); 
  
$query mysql_query("SELECT * FROM settings WHERE id='$id' ");
  while (
$row mysql_fetch_array($query))
  {
$title=$row['title']
echo 
"<form action=save.php?id=$id method=post>" ;
echo 
"title: <input type=text id=title name=title value=$title>" ;
echo 
"logo: <input type=text id=logo name=logo value=$row['logo']>" ;
echo 
"<br>text at homepage:" ;     

$oFCKeditor = new FCKeditor('$row['home']') ;
$oFCKeditor->BasePath 'fckeditor/' ;
$oFCKeditor->Value $home ;
$oFCKeditor->Create() ;

echo 
"<br>copyrights:" ;     

$oFCKeditor = new FCKeditor('$row['copyright']') ;
$oFCKeditor->BasePath 'fckeditor/' ;
$oFCKeditor->Value $copyrights ;
$oFCKeditor->Create() ;


echo 
"<input type=submit value=send>";
echo 
"</form>";

?>

הינה השגיאה שהוא מציג:
Parse error: syntax error, unexpected T_ECHO in /home/possible/domains/possible.9gb.us/public_html/cms/settings.php on line 10

Daniel 10-03-08 19:25

$title=$row['title']
חסר ;

possible 10-03-08 19:34

תיקנתי את הקוד אבל עכשיו הוא מציג לי דף ריק
PHP קוד:

<?php
include_once("fckeditor/fckeditor.php") ;

include 
"connect.php";
  
$query mysql_query("SELECT * FROM settings WHERE id=1 ");
  while (
$row mysql_fetch_array($query))
  {
$title=$row['$title'];
$home=$row['$home'];
$logo=$row['$logo'];
$copyright=$row['$copyright'];

echo 
"<form action=save.php?id=1 method=post>" ;
echo 
"title: <input type=text id=title name=title value=$title>" ;
echo 
"logo: <input type=text id=logo name=logo value=$logo>" ;
echo 
"<br>text at homepage:" ;     

$oFCKeditor = new FCKeditor('home') ;
$oFCKeditor->BasePath 'fckeditor/' ;
$oFCKeditor->Value $home ;
$oFCKeditor->Create() ;

echo 
"<br>copyrights:" ;     

$oFCKeditor = new FCKeditor('copyright') ;
$oFCKeditor->BasePath 'fckeditor/' ;
$oFCKeditor->Value $copyrights ;
$oFCKeditor->Create() ;
echo 
"<input type=submit value=send>";
echo 
"</form>";
}
?>


יניב בן צבי 10-03-08 19:45

תנסה לשנות את זה
$query = mysql_query("SELECT * FROM `settings` WHERE `id`='1' ");

possible 10-03-08 19:50

לא עוזר עדיין אותו הדבר.
עריכה: לא משנה הסתדרתי.

4ior 10-03-08 22:18

גבר אולי לפני שאתה שואל אותנו תנסה לפתור לבד?

קח קוד מתוקן:
PHP קוד:

<?php
include_once("fckeditor/fckeditor.php") ;

include 
"connect.php";
  
$query mysql_query("SELECT * FROM settings WHERE id='1' ");
  while (
$row mysql_fetch_array($query))
  {
    
$title=$row['title'];
    
$home=$row['home'];
    
$logo=$row['logo'];
    
$copyright=$row['copyright'];

echo 
"<form action='save.php?id=1' method='post'>" ;
echo 
"title: <input type='text' id='title' name='title' value='$title'>" ;
echo 
"logo: <input type='text' id='logo' name='logo' value='$logo'>" ;
echo 
"<br>text at homepage:" ;     

$oFCKeditor = new FCKeditor('home') ;
$oFCKeditor->BasePath 'fckeditor/' ;
$oFCKeditor->Value $home ;
$oFCKeditor->Create() ;

echo 
"<br>copyrights:" ;     

$oFCKeditor = new FCKeditor('copyright') ;
$oFCKeditor->BasePath 'fckeditor/' ;
$oFCKeditor->Value $copyrights ;
$oFCKeditor->Create() ;
echo 
"<input type=submit value=send>";
echo 
"</form>";
}
?>



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

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