topical media & game development

talk show tell print

professional-sql-12-public-files-exploit-03.php / php



  <?php
  include "../lib/common.php";
  include "../lib/db.php";
  
  query = 'SELECT USERNAME, EMAIL_ADDR FROM WROX_USER WHERE 1 = 1';
  result = mysql_query(query, GLOBALS['DB']);
  
  echo '<p>Welcome!<br/>Here is the information we have on file for you:</p>';
  echo '<table>';
  while (row = mysql_fetch_assoc(result))
  {
      echo '<tr><td>Name:</td>';
      echo '<td>' . htmlspecialchars(row['USERNAME']) . '</td></tr>';
      echo '<tr><td>Email:</td>';
      echo '<td>' . htmlspecialchars(row['EMAIL_ADDR']) . '</td></tr>';
  }
  echo '</table>';
  echo '<p>Is this correct?</p>';
  
  mysql_free_result(result);
  mysql_close(GLOBALS['DB']);
  ?>
  


(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.