[ PHPXref.com ] [ Generated: Sun Jul 20 19:05:20 2008 ] [ OpenNewsletter 2.4.3 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> subscribe.php (source)

   1  <?
   2      session_start();
   3      require_once ("includes/config.php");
   4      
   5      if($_GET["action"] == "subscribe")
   6      {    
   7          $fp = fopen("$db_file", "r");
   8          $file_text = fread($fp, 999999);
   9          fclose($fp);
  10          
  11          $subscribers = explode(",",$file_text);
  12          foreach($subscribers as $subscriber)
  13          {
  14              if($subscriber == $_GET["email"])
  15              {
  16                  $result = 1;
  17                  break;
  18              }
  19              else
  20              {
  21                  $result = 0;
  22              }
  23          }
  24          
  25          if($result == 1)
  26          {
  27              print "The email you provided alreay exists. <a href='javascript:history.back(-1)'>please try again</a>";
  28          }
  29          else
  30          {
  31              $fp = fopen("$db_file", "a+");
  32              fwrite($fp, $_GET["email"] . ",");
  33              fclose($fp);
  34              print "You have been subscribed successfully. <a href='javascript:history.back(-1)'>back</a>";
  35          }
  36      }
  37      else
  38      {
  39          print "
  40  
  41          
  42          ";
  43      }
  44  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]