Jump to content

Archived

This topic is now archived and is closed to further replies.

balkan

Web Links Script - Help Plz Repair

Recommended Posts

i need help about web links script, in script not have LOGOUT and you can login only whit password not username, and the password is saved to config, so i just want to login in to username and password called to mysql not to config and add logout button ... and maybe have error in: main.php?url=www.kafic.net !
anyone repair this script and reupload ?

download from:
[code]http://labunista.a22.biz/links.rar[/code]

size: 3.76 KB

Share this post


Link to post
Share on other sites
[!--quoteo(post=378229:date=May 29 2006, 05:26 PM:name=balkan)--][div class=\'quotetop\']QUOTE(balkan @ May 29 2006, 05:26 PM) [snapback]378229[/snapback][/div][div class=\'quotemain\'][!--quotec--]
i need help about web links script, in script not have LOGOUT and you can login only whit password not username, and the password is saved to config, so i just want to login in to username and password called to mysql not to config and add logout button ... and maybe have error in: main.php?url=www.kafic.net !
anyone repair this script and reupload ?

download from:
[code]http://labunista.a22.biz/links.rar[/code]

size: 3.76 KB
[/quote]

Sorry, not downloading any zips from someone with no posts. Post the code here and we can help.

Share this post


Link to post
Share on other sites
ok

admin.php
[code]
<?     
include "config.inc.php";
    if ($pw == $passwort) {
        setcookie("pw",$pw,time()+(3600*24*7)); }
    include "header.php";
    if ($pw != $passwort)
      { ?><form action="admin.php" method="post">
            <p>Password:<br>
            <input type="password" name="pw"></p>
            <input type="submit" value="Prati">
          </form>
<?               include "footer.php";
            exit;
      } else
  {     
    mysql_connect($sqlhost,$sqluser,$sqlpass) or die ("Couldn't connect to MySQL Server!");
    mysql_select_db($database) or die ("Keine Verbindung zur Datenbank!"); ?>
<h2>Administracija</h2>
<p><strong><a href="admin.php?do=add">Dodaj Nov Link</a> | <a href="admin.php">Admin Home</a></strong></p>
<?  if ($do=="insert")
      {
      
            $query = "INSERT INTO $table VALUES ('', '$url','$descr','$title', '$date', '0')";
            mysql_query($query) or die (mysql_error());
            echo "<strong><font color=\"#FF0000\">Der Link $url wurde in die Datenbank aufgenommen!</font></strong>";
      }
    elseif ($do=="delete")
         {
            if ($ask) {
            echo "<p>Dali si Siguren??</p>";
            echo "<a href=\"admin.php?do=delete&id=$id\">Da</a>  <a href=\"admin.php\">Ne</a>"; }
            else {
              $result = mysql_query("DELETE FROM $table WHERE id = '$id'") or die (mysql_error("Konnte nicht lцschen!"));
              echo "<strong><font color=\"#FF0000\">Linkot e uspesno izbrisan!</font></strong>"; }
        }
    elseif ($do=="change")
        {
            if ($change) {
                mysql_query("UPDATE $table SET url = '$url', title = '$title' WHERE id = $id")  or die (mysql_error());
                mysql_query("UPDATE $table SET descr='$descr' WHERE id = $id")  or die (mysql_error());
                echo "Datensatz aktualisiert!";
            } else
            {
            $query = "SELECT * FROM $table WHERE id = '$id'";
            $result = mysql_query($query) or die (mysql_error());
            echo "<form action=\"admin.php?do=change&id=$id&change=1\" method=\"post\">";
            echo "<table width=\"80%\"><tr><td colspan=\"2\">Promena na Linkot</td></tr><tr><td colspan=\"2\">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</td></tr>";
            while ($daten = mysql_fetch_array($result)) {
                echo "<tr><td>URL:</td><td><input type=\"text\" name=\"url\" value=\"$daten[url]\" size=\"45\"></td></tr>\n";
                echo "<tr><td>Naslov:</td><td><input type=\"text\" name=\"title\" value=\"$daten[title]\" size=\"45\"></td></tr>\n";
                echo "<tr><td>Opis:</td><td><textarea cols=\"35\" rows=\"15\" name=\"descr\">$daten[descr]</textarea></td></tr>\n";
                echo "<tr><td><input type=\"reset\"></td><td><input type=\"submit\"></td></tr>\n";
            }
            echo "</table>";
            echo "</form>";
            }
        }
    elseif ($do=="add")
     {
         echo "<form action=\"admin.php?do=insert\" method=\"post\"><table><tr><td colspan=\"2\">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</td></tr>";
        echo "<tr><td>URL:</td><td><input type=\"text\" name=\"url\" maxlength=\"250\" size=\"45\"></td></tr>";
        echo "<tr><td>Naslov:</td><td><input type=\"text\" name=\"title\" maxlength=\"250\" size=\"45\"></td></tr>";
        echo "<tr><td valign=\"top\">Opis:</td><td><textarea cols=\"35\" rows=\"10\" name=\"descr\"></textarea></td></tr>";
        echo "<input type=\"hidden\" name=\"date\" value=\"".date($zeit)."\">";
        echo "<tr><td><input type=\"reset\"></td><td><input type=\"submit\"></td></tr></table></form>";
     } else {
    $query = "SELECT * from $table ORDER BY id desc";
    $result = mysql_query($query) or die (mysql_error()); ?>

<table>
<tr><td colspan="4">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</td></tr>
<tr><td><em>Linkname</em></td><td><em>Url</em></td><td colspan="2"></td></tr>
<?    while ($daten = mysql_fetch_array($result)) {
        echo "<tr><td>$daten[title]</td><td>$daten[url]</td><td><a href=\"admin.php?do=change&id=$daten[id]\">change</a></td><td><a href=\"admin.php?do=delete&ask=1&id=$daten[id]\">delete</a></td></tr>";
     } ?>
</table>
<?
    }
}
    echo "<div align=\"right\"><font size=\"-1\">© <a href=\"http://www.google.com\">labunista.org</a> 2006</font></div>";
include "footer.php"; ?>[/code]

config.inc.php
[code]<?

// ADMIN PASSWORD LOGIN
$passwort = "admin";

//DATUMSFORMATIERUNG
$zeit = "j.m.Y";                 //j STEHT FЬR TAG, m FЬR MONAT, Y FЬR JAHR (Andere mцgl. Formatierung z.B. Y-m-j)

//SQL-DATEN
$sqlhost = '';     //SQLHOST
$sqluser = '';                     //SQLUSERNAME
$sqlpass = '';                     //SQLPASSWORD
$database = '';                  //DATABASE
$table = 'linklist';            //TABELLE

// AUSSEHEN
$color1 = '#a7a7a7';            // Titelhintergrundfarbe
$color2 = '#cbcbcb';            // Texthintergrundfarbe

// TOPLIST
$toplist = 1;                    // Anzeige der 5 meistgeklickten Links in einer Liste (1 = ein/0 = aus)
$toplist_nr = 3;                // Anzahl der Toplist-Eintrдge
?>[/code]

index.php
[code]<?     
include "config.inc.php";
    mysql_connect($sqlhost,$sqluser,$sqlpass) or die ("Couldn't connect to MySQL Server!");
    mysql_select_db($database) or die ("Keine Verbindung zur Datenbank!");
    if ($url)
        {
            $query = "UPDATE $table SET hits = hits + 1 WHERE url = '$url'";
              $result = @mysql_query($query);
            // Auf uebergebene URL weiterleiten
            Header("Location: ".$url);
        }
    else
    {
    include "header.php";
    if ($toplist)
      {
        echo "<p align=center><table align=center width=\"50%\" border=\"0\" cellspacing=\"0\"><tr bgcolor=\"$color1\"><td width=\"50%\"><strong>Top Linkovi</strong></td><td width=\"50%\"><strong>Hitovi</strong></td></tr>";
        $query = "SELECT * FROM $table ORDER BY hits DESC LIMIT 0,$toplist_nr";
        $result = mysql_query($query) or die (mysql_error());
        while ($daten = mysql_fetch_array($result))
            {
                echo "<tr bgcolor=\"$color2\"><td><a href=\"main.php?url=$daten[url]\">$daten[title]</a></td><td>$daten[hits]</td></tr>";
            }
        echo "</table></p>";
        mysql_freeresult($result);
      }
    
    $query = "SELECT * from $table ORDER BY id desc";
    $result = mysql_query($query) or die (mysql_error());
    while ($daten = mysql_fetch_array($result)) {
    ?>
<table width="90%" border="0" cellpadding="2" cellspacing="0">
<tr>
    <td bgcolor="<? echo $color1; ?>" colspan="2" valign="top"><b><a target="_blank" href="<? echo "main.php?url=".$daten[url]; ?>"><? echo $daten[title]; ?></a></b></td>
</tr>
<tr>
    <td width="5%"></td>
    <td width="95%" valign="top" bgcolor="<? echo $color2; ?>"><? echo $daten[descr]; ?></td>
</tr>
<tr>
    <td width="5%"></td>
    <td width="95%" valign="top" bgcolor="<? echo $color2; ?>"><font size="-1"><p align="right"><? echo $daten[url]." | $daten[datum] | ".$daten[hits]." Hitovi"; ?></p></font></td>
</tr>
</table><br>
<?         }
    }
    include "footer.php"; ?>[/code]

Share this post


Link to post
Share on other sites
can someone help put in this script logout code and repair [code]echo "main.php?url=".$daten[url]; [/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.