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

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

HBK 24-11-06 15:24

עזר | שגיאה
 
אני בונה מערכת תגובות והופיע לי השגיאה הזאת:

ציטוט:

Parse error: syntax error, unexpected $end in /home/asafshiri/domains/asaf.220mb.com/public_html/send.php on line 19
זה הקוד המלא:

PHP קוד:

<?Php
ob_start
();
require 
"config.php";
if(empty(
$_POST['author']) || empty($_POST['title']) || empty($_POST['email']) || empty($_POST['content'])){
    echo 
'נא מלא את כל השדות!';
  }else {
     
$IP $_SERVER['REMOTE_ADDR'];
      
$check mysql_query("SELECT * FROM comments WHERE IP = '$IP' AND ".time()." - time_sent > '30'");
          if(
mysql_num_rows($check) > 0){
                 echo 
'נא חכה שיעברו 30 שניות בין תגובה לתגובה';
           }
  else {
      
$author mysql_real_escape_string($_POST['author']);
     
$title mysql_real_escape_string($_POST['title']);
     
$email mysql_real_escape_string($_POST['email']);
     
$content mysql_real_escape_string($_POST['content']); 

     
$ip $_SERVER['REMOTE_ADDR'];
?>

מה עושים?

BBman 24-11-06 15:45

לא סגרת את ה-ELSE.

PHP קוד:

<?Php 
ob_start
(); 
require 
"config.php"
if(empty(
$_POST['author']) || empty($_POST['title']) || empty($_POST['email']) || empty($_POST['content'])){ 
    echo 
'נא מלא את כל השדות!'
  }else { 
     
$IP $_SERVER['REMOTE_ADDR']; 
      
$check mysql_query("SELECT * FROM comments WHERE IP = '$IP' AND ".time()." - time_sent > '30'"); 
          if(
mysql_num_rows($check) > 0){ 
                 echo 
'נא חכה שיעברו 30 שניות בין תגובה לתגובה'
           } 
  else { 
      
$author mysql_real_escape_string($_POST['author']); 
     
$title mysql_real_escape_string($_POST['title']); 
     
$email mysql_real_escape_string($_POST['email']); 
     
$content mysql_real_escape_string($_POST['content']);  

     
$ip $_SERVER['REMOTE_ADDR']; 
    }
?>


HBK 24-11-06 16:13

עכשיו יש שגיאה בשורה 20

-VladK- 24-11-06 16:53

לא סגרתה 2 ELSEים...חחחח
PHP קוד:

<?Php 
ob_start
(); 
require 
"config.php"
if(empty(
$_POST['author']) || empty($_POST['title']) || empty($_POST['email']) || empty($_POST['content'])){ 
    echo 
'נא מלא את כל השדות!'
} else { 
    
$IP $_SERVER['REMOTE_ADDR']; 
    
$check mysql_query("SELECT * FROM comments WHERE IP = '$IP' AND ".time()." - time_sent > '30'"); 
    if(
mysql_num_rows($check) > 0){ 
        echo 
'נא חכה שיעברו 30 שניות בין תגובה לתגובה'
    } else { 
        
$author mysql_real_escape_string($_POST['author']); 
        
$title mysql_real_escape_string($_POST['title']); 
        
$email mysql_real_escape_string($_POST['email']); 
        
$content mysql_real_escape_string($_POST['content']);  

        
$ip $_SERVER['REMOTE_ADDR']; 
    }
}
?>



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

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