View file fastwap/insert.php

File size: 3.15Kb
<?

include "../../fastwap.inc.php";

//============================================================================
//Fastwap v.1.3 - a Linkmamager for WAP-Phones
//Copyright (C) 2001  webDessert.ch <[email protected]>
//	
//	This program is free software; you can redistribute it and/or
//	modify it under the terms of the GNU General Public License
//	as published by the Free Software Foundation; either version 2
//	of the License, or (at your option) any later version.
//	
//	This program is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU General Public License for more details.
//	
//	You should have received a copy of the GNU General Public License
//	along with this program; if not, write to the Free Software
//	Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 021111307, USA.
// ==============================================================================

?>

<html>

<head><title>Daten hinzufьgen</title>

<link rel="STYLESHEET" media="screen" href="site.css" type="text/css">

<meta http-equiv="refresh" content="0; URL=display.php">

<meta http-equiv="Pragma" content="no-cache">

<meta http-equiv="expires" content="0">



</head>

<body bgcolor="#ffffff" text="#000000">

<br><br>



<?

if(!$password || !$username)

{

echo "<p>wrong password / password expired. Please log in <a href=\"$path_fastwap\">here</a>.</p>"; 


exit();

}

$dbcnx = mysql_connect("$db_host", "$db_user", "$db_pass");

if (!$dbcnx) {

  echo( "<P>Unable to connect to the " .

        "database server at this time.</P>" );

  exit();

}



mysql_select_db("$db_dbname", $dbcnx) or die(mysql_error());

echo("Test 1");



// Request password and ID from usertable

	$result = mysql_query(

              "SELECT  password FROM fastwap_person WHERE username = '$username'");

	if (!$result)

	{

      		echo("<P>Error performing query: " .

		mysql_error() . "</P>");

      		exit();    

	}

// fetch password and compare password from cookie

	while ( $row = mysql_fetch_array($result) ) 

	{

		$password_verify = $row["password"];

	}

if ($password != $password_verify)

{

echo "<p>wrong password / password expired. Please log in <a href=\"$path_fastwap\">here</a>.</p>"; 


exit();

}

echo("Test 2<br>");

$deletequery = "DELETE FROM fastwap_link WHERE IDname = '$ID'";

$deleteresult = mysql_query($deletequery);

echo("Test 3<br>");











$i = 0;

while($i <= $i_fields)

{

$i++;



//Eval Linkname

$linkname_eval = '$linkname$i';

eval ("\$linkname_eval = \"$linkname_eval\";");



//Eval Linkurl

$linkurl_eval = '$linkurl$i';

eval ("\$linkurl_eval = \"$linkurl_eval\";");



$insertquery = "INSERT INTO fastwap_link values('','$ID', '$linkname_eval', '$linkurl_eval', '$password')";

$resultinsert = mysql_query($insertquery, $dbcnx);



echo("Linkname$i: $linkname_eval<br>");

echo("Linkurl$i: $linkurl_eval<br><br>");

}



mysql_close();



?>

</body>

</html>