topical media & game development

talk show tell print

basic-php-02-movie1-rev05.php / php



  <?php
  //delete this line: setcookie('username', 'Joe', time()+60);
  session_start();
  _SESSION['username'] = _POST['user'];
  _SESSION['userpass'] = _POST['pass'];
  _SESSION['authuser'] = 0;
  
  //Check username and password information
  if ((_SESSION['username'] == 'Joe') and
      (_SESSION['userpass'] == '12345')) {
    _SESSION['authuser'] = 1;
  } else {
    echo "Sorry, but you don't have permission to view this
         page, you loser!";
    exit();     
  }
  ?>
  <html>
  <head>
  <title>Find my Favorite Movie!</title>
  </head>
  <body>
  <?php
    myfavmovie = urlencode("Life of Brian");
    echo "<a href='moviesite.php?favmovie=myfavmovie'>";
    echo "Click here to see information about my favorite movie!";
    echo "</a>";
  ?>
  </body>
  </html>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.