All pastes #897802 Raw Edit

Zeug

public text v1 · immutable
·published 2008-02-09 21:16 UTC
rendered paste body
<?php
        include "inc/sites.php"; // die Konfigurationsdateien lesen.
        include "inc/config.php"; // Configparameter für die DB einlesen
        include "inc/connect_db.php"; // Zur DB Connecten


$aryLinks = explode("\n", $_POST['links']);
$intOldURL = 0;
$intNewURL = 0;

foreach($aryLinks as $strSingleLine)
{
        if (isset($strLinks)) {
                echo "a";
        } else {
                echo "b";
        }

//      echo "asdasd".$strLink."asdsad";
        $strLink = trim($strSingleLine);
        $sql="SELECT COUNT(link) AS COUNT FROM plaintextlinks WHERE link = '".$strLink."';";
        $result = mysql_query($sql) OR die(mysql_error());
        $row = mysql_fetch_assoc($result);
        if ($row['COUNT'] == 0) {
                $sql2 = "INSERT INTO plaintextlinks (`link`) VALUES (\"".$strLink."\");";
                $intNewURL++;
                mysql_query($sql2) OR die(mysql_error());
        } else {
                $intOldURL++;
        }
}

        $sql="SELECT COUNT(link) AS COUNT FROM plaintextlinks;";
        $result = mysql_query($sql) OR die(mysql_error());
        $row = mysql_fetch_assoc($result);



echo "You just added ".$intOldURL." Links that are allready in the DB and ".$intNewURL." New Links.<br \> I protect ".$row['COUNT']." Links.<br />If you have a Problem d$

echo "<form action=plaintextlinks.php method=post>\n";
echo "<textarea name=\"links\" rows=\"20\" cols=\"90\"></textarea>\n";
echo "<br />\n";
echo "<input type=\"submit\" />\n";
echo "<input type=\"reset\" />\n";
echo "</form>\n";
?>