brauche Gästebuch in einer Datei

Dieses Thema im Forum "Webentwicklung" wurde erstellt von matze-pe, 2. Juni 2006 .

Status des Themas:
Es sind keine weiteren Antworten möglich.
  1. 2. Juni 2006
    Hallo,
    ich brauche ein Gästebuchscript, das nur eine Datei groß ist.
    Klingt komisch, ist es auch
    vielen dank im voraus
    mfg
    matze-pe
     
  2. 2. Juni 2006
    How about selber coden?


    Vorlage:
    PHP:
    <?
    if(isset(
    $_GET [ 'action' ]))  $Action  $_GET [ 'action' ]; else  $Action  false ;
    if(isset(
    $_POST [ 'GoForIt' ]))  $Los  true ; else  $Los  false ;

    if(!
    $Action )
    {
    // Formular
    ?>
    <form action="deinedatei.php?action=go" method="POST">
    <input type="submit" name="GoForIt" value="Los">
    </form>
    <?
    }
    if(
    $Action  ==  'go' )
    {
    // Daten auslesen
    $Bla [ 0 ] =  $_POST [ 'Name' ];  // etc.
    if(! $GoForIt )
    {
    // Falscher Aufruf
    }
    else
    {
    // Richtiger aufruf, daten check0rn
    if(! $Bla [ 0 ])  $error  .= '<li>Nix name</li>' ;

    if(
    $error )  echo  '<ul>' . $error . '</ul>' ;
    else
    {
    // NIX ERROR also Eintragen
    mysql_query ( "INSERT INTO Gb ...." );
    }
    }
    }

    ?>
    Much fun beim Coden.
     
  3. 2. Juni 2006
    bin php laie,
    sonst würde ich ja nicht fragen ob jemand so einen script hat,
    mfg
    matze-pe
     
  4. 2. Juni 2006
    http://www.php-free.de/Gaestebuecher/


    vllt findeste da ja eins, was nur eine datei groß oist...


    frage: WIESO??? xD
     
  5. 2. Juni 2006
    weil ich ein php noob bin und sonst das immer mit iframe gelöst habe, aber das ist auf lange zeit öde.
    habe sowas, kp wie das heißt, aber sowas index.php?action=start
    und das mussich (als php laie) bei allen links machen im gb.
    also kp wie ich das sonst regeln soll.
    mfg
    matze-pe
     
  6. 2. Juni 2006
    PHP != schwer.
    Google
    Suche: Q-NET PHP TUT
     
  7. 2. Juni 2006
    und was soll das?
    ich brauch ein script und keine tutorials von was anderem
    trotzdem thx
    mfg
    matze-pe
     
  8. 3. Juni 2006
    warum muss es denn in einer datei sein ? kann dir doch egal sein, ob die index.php vom gb auf weitere php-dateien zugreift.

    und wenn du es nicht per iframe einbinden willst, dann halt in einem neuen Fenster oder per include()
     
  9. 3. Juni 2006
    ich wollte das woltlab burning book includen,
    aber es kommen fehler von der global.php

    mfg
    matze-pe
     
  10. 3. Juni 2006
    poste mal den fehlercode
    oder meld dich bei mir per pn, ich habe auch das burning board, und bei mir geht alles wunderbar.
     
  11. 3. Juni 2006
    Was unterstützt dein Webspace denn? PHP, ok! Perl?

    Ich würde an deiner Stelle mal bei freshmeat.net suchen. Die Perlcoder dort sind ziemliche Freaks und es gibt bestimmt das was du suchst.
    [..] Gelöscht [..]
     
  12. 3. Juni 2006
    wer lesen kann ist klar im Vorteil
     
  13. 4. Juni 2006
    Code:
    Warning: require() [function.require]: Unable to access ./global.php in /var/www/web10/html/julian/book/index.php on line 4
    
    Warning: require(./global.php) [function.require]: failed to open stream: No such file or directory in /var/www/web10/html/julian/book/index.php on line 4
    
    Fatal error: require() [function.require]: Failed opening required './global.php' (include_path='.') in /var/www/web10/html/julian/book/index.php on line 4
    das is der felhler
    mfg
    matze-pe
     
  14. 7. Juni 2006
    +push+
    mfg
    matze-pe
     
  15. 7. Juni 2006

    ich denke mal, da du nun om intzerordner book bist, muss es nich require("./global.php") seinm sondern require("../global.php")


    änder das mal...

    mfg

    cydoc 8)
     
  16. 7. Juni 2006
    wo muss ich das denn ändern?
    mfg
    matze-pe
     
  17. 7. Juni 2006
    So das Gb hab ich letztens geschrieben. CSS-Datei ist auch dabei.
    Versuchs ein bisschen umzuändern da ich den selben Style auch bei mir habe.
    Lass das Copyright drinne.


    PHP:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>tons gbook</title>
    <link href="http://hier ist deine seite/stylesheet.css" rel="stylesheet" type="text/css">

    </head>

    <body >

    <?php


    $dbhost  "localhost" ;
    $dbname  "DAtenbankname" ;
    $dbuser  "user" ;
    $dbpass  "passwort" ;

    $connect  = @ mysql_connect ( $dbhost $dbuser $dbpass ) or die( "Konnte keine Verbindung zur Datenbank herstellen!" );
    $selectDB  = @ mysql_select_db ( $dbname $connect ) or die( "Konnte die Datenbank <b> $dbName </b> nicht auswählen!" );



    list( $gesamt ) =  mysql_fetch_row ( mysql_query ( "SELECT COUNT(id) FROM gbook " ));
    $num_sites  ceil ( $gesamt / 10 );
    $seite = $_GET [ 'seite' ];
    if (
    $seite == '' ){ $seite = 1 ;}
    $start =( $seite - 1 )* 10 ;
    echo 
    '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td width="70%">' ;


    if( $seite  !=  1 )
    {
        
    $seite_zurueck  $seite  1 ;
        echo 
    '<a href="gbook?=' . $seite_zurueck . '" class="gbook_normal"><</a>' ;
    }

    while ( $i <= $num_sites )
           {
              echo 
    '<a href="gbook.php?seite=' . $i . '" class="gbook_normal">' . $i . '</a>&nbsp;' ;
              
    $i += 1 ;
           }

    if( $seite  !=  $num_sites )
    {
        
    $seite_weiter  $seite  1 ;
        echo 
    '<a href="gbook?seite=' . $seite_weiter . '" class="gbook_normal">></a>' ;
    }

    echo 
    '</td><td align="right"><font class="gbook_normal">Gesamteintr&auml;ge:&nbsp;' . $gesamt . '</font></td><tr><table>' ;






    $g_query  = @ mysql_query ( "SELECT * FROM gbook ORDER BY id DESC LIMIT " . $start . ", 10" ) or die( 'no way' );
    while(
    $g_result  = @ mysql_fetch_array ( $g_query ))
    {
        

        
    $datum  date ( "d.m.Y" , $g_result [ 'gtime' ]);
        
    $uhrzeit  date ( "H:i" , $g_result [ 'gtime' ]);
        echo 
    '<table width="100%" height="100%"  border="0" cellpadding="0" cellspacing="0" class="gbook_rahmen"><tr><td height="20" class="gbook_rahmen2"><font class="gbook_normal">' ;
        echo 
    $g_result [ 'user' ].  '</font><td align="right" class="gbook_rahmen2"><font class="gbook_normal">' ;
        echo 
    $datum '&nbsp;-&nbsp;'  . $uhrzeit 'Uhr</font></td></td></tr><tr align="left" valign="top">' ;
        echo 
    '<td class="gbook_content" colspan="2">'  . nl2br ( $g_result [ 'kommentar' ]).  '</td></tr></table>' ;
    }





    if(isset( $_POST [ 'gb_submit' ]))
    {
        if(!isset(
    $_POST [ 'gb_nick' ]) ||  $_POST [ 'gb_nick' ] ==  "" ){echo  '<p align="center" class="gbook_content">Benutzername fehlt!</p>' ;}
        elseif(!isset(
    $_POST [ 'gb_content' ]) ||  $_POST [ 'gb_content' ] ==  ""  ){echo  '<p align="center" class="gbook_content">Text fehlt!</p>' ;}
        else
        {
            
    $gb_nick  $_POST [ 'gb_nick' ];
            
    $gb_content  $_POST [ 'gb_content' ];
            
    $time  time ();
            if(
    $gb_sql  = @ mysql_query ( "INSERT INTO gbook SET user = ' $gb_nick ', kommentar = ' $gb_content ', gtime = ' $time '" )){echo  '<p align="center" class="gbook_content">Eingetragen!<br><a href="./gbook.php" class="menucontent">Weiter</a></p>' ;}
            else{echo 
    '<p align="center" class="gbook_content">Datenbankfehler</p>' ;}
        }
    }







    echo  '<form action="./gbook.php" method="post">
    <table width="100%" height="100%"  border="0" cellpadding="1" cellspacing="0" class="gbook_rahmen">
      <tr>
        <td><table width="100%"  border="0" cellspacing="0" cellpadding="1">
          <tr>
            <td width="13%" align="center" class="gbook_content">Name:</td>
            <td width="87%" height="30">
              <input type="text" name="gb_nick" class="input" size="30" maxlength="50"></td>
          </tr>
          <tr>
            <td align="center" valign="top" class="gbook_content">Text:</td>
            <td height="200" align="left" valign="top"><textarea name="gb_content" cols="45" rows="6" class="input"></textarea><br>
            <br><input name="gb_submit" type="submit" class="button" id="gb_submit" value="Abschicken"></td>
          </tr>
        </table></td>
      </tr>
    </table><p class="gbook_content" align="center">tons gbook</p>'
    ;
    ?>
    </body>
    </html>


    CSS:
    Code:
    /* Gaestebuch */
    .gbook_normal {color: #666666; font-size: 12px; padding: 2px;}
    .gbook_content {color: #666666; font-size: 13px; padding: 4px;}
    .gbook_rahmen {border-style: solid; border-width: thin; border-color: #66ae04; margin: 2px;}
    .gbook_rahmen2 { border-bottom: 1px solid #66ae04; }
    .gbook_rahmen3 {border-style: solid; border-width: thin; border-color: #66ae04;}
    
     
  18. 8. Juni 2006
    das in phpmyadmin
    sollich das in der datei stehen lassen oder
    einfach direkt in phpmyadmin reinkopieren?
    mfg
    matze-pe

    //Edit:
    SO habe alles angepasst.
    Nur jetzt kommt immer Datenbankfehler

    egal.
    ich mach das jetzt mit einer hässlichen iframe
     
  19. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.