Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Problem ze stroną


Rekomendowane odpowiedzi

Opublikowano

Tak jak w temecie potrzebuje pomocy nwm co jest grane chce dodać nowego newsa na strone wychodzi normalnie itp zrobie wyśli wyskakuje takie coś:

 

 

Notice: Undefined index: tag in /usr/local/www/apache22/data/pages/admin/news.php on line 13

Notice: Undefined index: stunde in /usr/local/www/apache22/data/pages/admin/news.php on line 15

Notice: Undefined index: minute in /usr/local/www/apache22/data/pages/admin/news.php on line 15

Notice: Undefined index: monat in /usr/local/www/apache22/data/pages/admin/news.php on line 15

Notice: Undefined index: tag in /usr/local/www/apache22/data/pages/admin/news.php on line 15

Notice: Undefined index: jahr in /usr/local/www/apache22/data/pages/admin/news.php on line 15

Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead in /usr/local/www/apache22/data/pages/admin/news.php on line 15

News wurden erfolgreich eingetragen.

Pomocy tu jest news.php:

<?PHP
  if($_SESSION['user_admin']>=$adminRights['web_news']) {
?>

<h2>Napisz News</h2>
<p></p>

<h3></h3>

<?PHP
  if(isset($_POST['submit']) && $_POST['submit']=="eintragen")
  {
    if(!empty($_POST['titel']) && !empty($_POST['inhalt']) && checkInt($_POST['kategorie']) && checkBetween($_POST['tag'],0,31))
    {
      $zeitStempel = mktime($_POST['stunde'],$_POST['minute'],0,$_POST['monat'],$_POST['tag'],$_POST['jahr']);
      // id     titel     inhalt     datum     hot     kategorie     author     anzeigen
      
      $anzeigen = (isset($_POST['anzeigen']) && $_POST['anzeigen']=="true") ? 1 : 0;
      $wichtig = (isset($_POST['wichtig']) && $_POST['wichtig']=="true") ? 1 : 0;
      
      
      $sqlNews = "INSERT INTO ".SQL_HP_DB.".news
      VALUES (NULL,'".mysql_real_escape_string($_POST['titel'])."','".mysql_real_escape_string($_POST['inhalt'])."','".$zeitStempel."','".$wichtig."','".$_POST['kategorie']."','".$_SESSION['user_id']."','".$anzeigen."')";
      
      if(mysql_query($sqlNews,$sqlHp))
      {
        echo'<p class="meldung">News wurden erfolgreich eingetragen.</p>';
      }
      else
      {
        echo'<p class="meldung">News konnten nicht in die Datenbank gespeichert werden.</p>';
      }
    }
  }
?>

<form method="POST" action="index.php?s=admin&a=news">
 
  <table>
    <tr>
      <th class="topLine">Nazwa News'a:</th>
      <td class="thell"><input type="text" size="40" maxlength="200" name="titel"/></td>
    </tr>
    <tr>
      <th class="topLine">Opis:</th>
      <td class="tdunkel"><textarea rows="15" cols="90" name="inhalt"></textarea></td>
    </tr>
    <tr>
    </tr>
    <tr>
      <th class="topLine">Kategoria:</th>
      <td class="thell">
        <?PHP listNewsKat(); ?>
      </td>
    </tr>
    <tr>
      <th class="topLine">WaĹĽne:</th>
      <td class="tdunkel"><input type="checkbox" name="wichtig" value="true"/></td>
    </tr>
    <tr>
      <th class="topLine">Pokazać News:</th>
      <td class="thell"><input type="checkbox" name="anzeigen" value="true"/></td>
    </tr>
    <tr>
      <th class="topLine" colspan="2"><input type="submit" name="submit" value="eintragen"/></th>
    </tr>
  </table>
</form>

<h3>Lista NewsĂłw</h3>
<table>
  <tr>
    <th class="topLine">ID</th>
    <th class="topLine">TytuĹ‚</th>
    <th class="topLine">Kategoria</th>
    <th class="topLine">WaĹĽny</th>
    <th class="topLine">WidocznoĹ›c</th>
    <th class="topLine">Löschen</th>
  </tr>
  <?PHP
    $sqlNews = "SELECT * FROM ".SQL_HP_DB.".news ORDER BY datum DESC";
    $qryNews = mysql_query($sqlNews,$sqlHp);
    $x=0;
    while($getNews = mysql_fetch_object($qryNews))
    {
      $nWichtig = ($getNews->hot>0) ? "./img/success.gif" : "./img/fail.gif";
      $nAnzeigen = ($getNews->anzeigen>0) ? "./img/success.gif" : "./img/fail.gif";
      
      $nTitel = (strlen($getNews->titel)>60) ? substr($getNews->titel,0,strpos($getNews->titel,' ',60)).'...' : $getNews->titel;
      
      $zF = ($x%2==0) ? "tdunkel" : "thell";
      echo'<tr>
        <td class="'.$zF.'">'.$getNews->id.'</td>
        <td class="'.$zF.'">'.getDatum($getNews->datum).'</td>
        <td class="'.$zF.'"><a href="index.php?s=admin&a=news_edit&id='.$getNews->id.'">'.$nTitel.'</a></td>
        <td class="'.$zF.'">'.$newsKategorien[$getNews->kategorie].'</td>
        <td class="'.$zF.'"><img src="'.$nWichtig.'" alt="wichtig"/></td>
        <td class="'.$zF.'"><img src="'.$nAnzeigen.'" alt="wichtig"/></td>
        <td class="'.$zF.'"><a href="index.php?s=admin&a=news_delete&id='.$getNews->id.'"><img src="./img/fail.gif" alt="delete"/></a></td>
      </tr>';
      $x++;
    }
  ?>
</table>
<?PHP
  }
  else {
    echo'<p class="meldung">Kein Zugriff auf diesen Bereich!</p>';
  }
?>

 

 

5217114269229401272396.png

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...