Navigazione

    Privacy - Termini e condizioni
    © 2020 Search On Media Group S.r.l.
    • Registrati
    • Accedi
    • CATEGORIES
    • Discussioni
    • Non letti
    • Recenti
    • Hashtags
    • Popolare
    • Utenti
    • Stream
    • Interest
    • Categories
    1. Home
    2. macromedio
    3. Discussioni
    M

    macromedio

    @macromedio

    • Profilo
    • Chi segue 0
    • Da chi è seguito 0
    • Discussioni 3
    • Post 4
    • Migliore 0
    • Gruppi 0
    Iscrizione Ultimo Accesso
    0
    Reputazione
    4
    Post
    0
    Visite al profilo
    0
    Da chi è seguito
    0
    Chi segue
    User Newbie

    badges

    0
    Bookmarks
    0
    Voti
    0
    Ringraziamenti
    0
    Miglior risposte
    Inizia una nuova discussione
    di cosa vuoi parlare?

    Discussioni create da macromedio

    • Topic
      Post
      View
      Votazioni
      Post
      Attività
    • M

      Fatal error: Call to a member function
      Coding • • macromedio  

      2
      483
      Visualizzazioni
      0
      Votazioni
      2
      Post

      M

      Ciao macromedio,
      secondo me l'oggetto $ph è nullo.

      Probabilmente durante la creazione dell'istanza succede
      qualcosa, te non intercetti l'errore
      e al momento di utilizzarlo ti genera l'errore.

      Prova a fare prima questo test:
      [php]
      if(!isset($ph) || empty($ph))
      die("Oggetto non utilizzabile");
      [/php]Ciao

    • M

      Generare pagine php con "article manager"
      Coding • • macromedio  

      2
      699
      Visualizzazioni
      0
      Votazioni
      2
      Post

      M

      Di seguito il codice in unica pagina invio e gestione informazioni.

      <html>
      <body bgcolor=yellow>
      <basefont size=2 face=arial>
      <b>Add Article</b>
      <?
      include ("template.inc");
      include ("config.php");
      $summary_template = "t_summary.html";
      $article_template = "t_article.html";
      $max_summary = 5;
      function summary_page ($subject, $date, $summary, $article_id)
      {
      global $summary_template;
      $t = new Template();
      $t->set_file("SummaryPage", $summary_template);
      $article_url = "article_".$article_id.".html";
      $date = nl2br($date);
      $summary = nl2br($summary);
      $t->set_var( arrray(
      "subject" => $subject,
      "date" => $date,
      "summary" => $summary,
      "article_url" => $article_url
      ));
      $t->parse("Summary", "SummaryPage");
      return $t->get_var("Summary");
      }
      function main_page ($subject, $date, $summary, $article_id, $body)
      {
      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( aray(
      "subject" => $subject,
      "date" => $date,
      "summary" => $summary,
      "body" => $body,
      "article_url" => $article_url
      ));
      $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($fh, filesize($filename));
      fclose($fh);
      }
      /* TODO: Multipage articles
      preg_match_all("<!--ARTICLE PAGE=(\d*)-->", $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<!--ARTICLE-->\n$news $old_news");
      fclose($fh);
      }
      ?>
      <?
      if(strcmp($subject, "")){
      if(!(strcmp($passwd, $password))){
      add_article("article_summary.html", summary_page($subject, $date, $summary, $article_id));
      add_article("article_$article_id.html", main_page($subject, $date, $summary, $article_id, $body));
      echo "<p> Article has been added! <p>";
      }else{
      echo "<p><b> Password is wrong! </b>";
      }
      }
      ?>

      <form action=news.php method=post>
      <table border=0>
      <tr> <td> (Password): </td><td> <input type=text name=passwd size=30> </td></tr>
      <tr> <td> Subject: </td><td> <input type=text name=subject size=30> </td></tr>
      <tr> <td> Article ID: </td><td> <input type=text name=article_id value=<? echo date("Y_m_j_is"); ?> size=30> </td></tr>
      <tr> <td> Date/Author/etc: </td><td> <textarea name=date rows=2 cols=30 wrap=soft><? echo date("M j, Y\n"); ?>Author: </textarea> </td></tr>
      <tr> <td> Summary: </td><td> <textarea name=summary rows=5 cols=30 wrap=soft></textarea> </td></tr>
      <tr> <td> Body: </td><td> <textarea name=body rows=15 cols=30></textarea> </td></tr>
      </table>
      <input type=submit name=submit value=Add>
      </form>

      <p>
      <a href=source.php?f=news.php>Source</a>

    • M

      Macromedio saluta tutti gli utenti del forum
      Presentati alla Community • • macromedio  

      5
      404
      Visualizzazioni
      0
      Votazioni
      5
      Post

      K

      Ciao Macromedio

      benvenuto fra noi.