Visualizzazione dei risultati da 1 a 3 su 3

Discussione: Missing argument

  1. #1

    Missing argument

    Cia rigaz, ho un problema...

    Ho adattato a un sito che sto facendo per un amica un modulo per l'aggiunta delle news, però non capisco perchè quando do l'ok per inviare la news il php inserisce la news correttamente ma mi da questi 2 errori...

    Missing argument 5 for summary_page()

    Missing argument 6 for main_page()

    Io credo che litighi con la variabile $ppp, una variabile che ho aggiunto io dopo perchè senza non dava errori

    Posto il codice se potesse essere utile...

    Codice PHP:
    <?
            
    include ("template.inc");
            include (
    "config.php");

        
    $summary_template "t_summary.html";
        
    $article_template "t_article.html";
        
    $max_summary 6;

        function 
    summary_page ($subject$date$summary$article_id$ppp)
        {
            global 
    $summary_template;
                
    $t = new Template();
                
    $t->set_file("SummaryPage"$summary_template);
            
    $article_url "news_".$article_id.".html";
            
    $date nl2br($date);
            
    $summary =  nl2br($summary);
            
    $t->set_var( array(
                    
    "subject" => $subject,
                    
    "date"    => $date,
                    
    "summary" => $summary,
                    
    "article_url" => $article_url,
                    
    "ppp" => $ppp
                    
    ));
            
    $t->parse("Summary""SummaryPage");
            return 
    $t->get_var("Summary");
        }
        function 
    main_page ($subject$date$summary$article_id$body$ppp)
        {
            global 
    $article_template;

                    
    $t = new Template();
                    
    $t->set_file("ArticlePage"$article_template);
                    
    $article_url "article_".$article_id.".html";
                    
    $date nl2br($date);
                    
    $summary =  nl2br($summary);
                    
    $body =  nl2br($body);
                    
    $t->set_var( array(
                                    
    "subject" => $subject,
                                    
    "date"    => $date,
                                    
    "summary" => $summary,
                                    
    "body" => $body,
                                    
    "article_url" => $article_url,
                                    
    "ppp" => $ppp
                                    
    ));
                    
    $t->parse("Article""ArticlePage");
                    return 
    $t->get_var("Article"); 
        }

        function 
    add_article($filename$news)
        {

            if(
    file_exists($filename)){
                
    $fh fopen($filename"r");
                
    $old_news fread($fhfilesize($filename));
                
    fclose($fh); 
            }

            
    /* TODO: Multipage articles
                preg_match_all("", $old_news, $matches;
            
                if( count($matches[0]) >= $max_summary){
                    $oldfilename = $filename.($matches[0][0]+1);
                } 
            */

            
    $fh fopen($filename"w");
            
    $news stripslashes($news);
            
    fwrite($fh"\n\n$news $old_news");
            
    fclose($fh);
        }

    ?>
    <?
        
    if(strcmp($subject"")){    
            if(!(
    strcmp($passwd$password))){    
                
    add_article("article_summary.html"summary_page($subjects$date$summary$article_id));            
                
    add_article("../../../eng/tuttenews.html"summary_page($subject$date$summary$article_id$ppp));
                
    add_article("news_$article_id.html"main_page($subject$date$summary$article_id$body));
                echo 
    "

     News aggiunta con successo 

    "
    ;
            }else{
                echo 
    "

    [b] Password Errata [/b]"
    ;
            }
        }
    ?>
    Grazie a tutti quelli che riusciriranno a darmi una dritta
    CiaoO!

  2. #2
    Utente di HTML.it L'avatar di Gab-81
    Registrato dal
    Nov 2005
    Messaggi
    558
    evidentemente quando richiami la funzione summary_page() invece di passare 5 argomenti, ne passi qualcuno in meno...vedi a che riga ti segnala l'errore e controlla come richiami la funzione...

  3. #3
    si esatto il problema era proprio questo, mi sono applicato tutto il pomeriggio ma alla fine l'ho messo a posto
    Grazie mille comunque
    CiaoO!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.