Просмотр файла fastwap/add_a_link.php

Размер файла: 2.62Kb
  1. <?
  2.  
  3. include "../../fastwap.inc.php";
  4.  
  5. // =============================================================================
  6.  
  7. //Fastwap v.1.3 - a Linkmamager for WAP-Phones
  8.  
  9. //Copyright (C) 2001 webDessert.ch <fastwap@webdessert.ch>
  10.  
  11. //
  12.  
  13. // This program is free software; you can redistribute it and/or
  14.  
  15. // modify it under the terms of the GNU General Public License
  16.  
  17. // as published by the Free Software Foundation; either version 2
  18.  
  19. // of the License, or (at your option) any later version.
  20.  
  21. //
  22.  
  23. // This program is distributed in the hope that it will be useful,
  24.  
  25. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  26.  
  27. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  28.  
  29. // GNU General Public License for more details.
  30.  
  31. //
  32.  
  33. // You should have received a copy of the GNU General Public License
  34.  
  35. // along with this program; if not, write to the Free Software
  36.  
  37. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  38.  
  39. // ==============================================================================
  40.  
  41. ?>
  42.  
  43. <html>
  44.  
  45. <head><title></title>
  46.  
  47. <link rel="STYLESHEET" media="screen" href="site.css" type="text/css">
  48.  
  49. <meta http-equiv="refresh" content="0; URL=display.php">
  50.  
  51. <meta http-equiv="Pragma" content="no-cache">
  52.  
  53. <meta http-equiv="expires" content="0">
  54.  
  55.  
  56.  
  57. </head>
  58.  
  59. <body bgcolor="#ffffff" text="#000000">
  60.  
  61. <br><br>
  62.  
  63.  
  64.  
  65. <?
  66.  
  67. if(!$password || !$username)
  68.  
  69. {
  70.  
  71. echo "<p>wrong password / password expired. Please log in <a href=\"$path_fastwap\">here</a>.</p>";
  72.  
  73.  
  74. exit();
  75.  
  76. }
  77.  
  78. $dbcnx = mysql_connect("$db_host", "$db_user", "$db_pass");
  79.  
  80. if (!$dbcnx) {
  81.  
  82. echo( "<P>Unable to connect to the " .
  83.  
  84. "database server at this time.</P>" );
  85.  
  86. exit();
  87.  
  88. }
  89.  
  90.  
  91.  
  92. mysql_select_db("$db_dbname", $dbcnx) or die(mysql_error());
  93.  
  94.  
  95.  
  96.  
  97.  
  98. // Request password and ID from usertable
  99.  
  100. $result = mysql_query(
  101.  
  102. "SELECT password FROM fastwap_person WHERE username = '$username'");
  103.  
  104. if (!$result)
  105.  
  106. {
  107.  
  108. echo("<P>Error performing query: " .
  109.  
  110. mysql_error() . "</P>");
  111.  
  112. exit();
  113.  
  114. }
  115.  
  116. // fetch password and compare password from cookie
  117.  
  118. while ( $row = mysql_fetch_array($result) )
  119.  
  120. {
  121.  
  122. $password_verify = $row["password"];
  123.  
  124. }
  125.  
  126. if ($password != $password_verify)
  127.  
  128. {
  129.  
  130. echo "<p>wrong password / password expired. Please log in <a href=\"$path_fastwap\">here</a>.</p>";
  131.  
  132.  
  133. exit();
  134.  
  135. }
  136.  
  137.  
  138.  
  139. $insertquery = "INSERT INTO fastwap_link values('','$ID', '$linkname', '$linkurl', '$password')";
  140.  
  141. $resultinsert = mysql_query($insertquery, $dbcnx);
  142.  
  143.  
  144.  
  145. mysql_close();
  146.  
  147.  
  148.  
  149. ?>
  150.  
  151. </body>
  152.  
  153. </html>