basic-php-10-charlist.php / php
<?php require('config.php'); if (isset(_GET['o'])) { _GET['o'], 1), 3)); } else { order = array(1 => 'alias ASC', 2 => 'name ASC', 3 => 'align ASC, alias ASC' ); conn); result = mysql_query(result) > 0) { while (result)) { row['id']][] = p as value) { key] = implode(", ", sql = "SELECT c.id, n.alias " . "FROM char_main c " . "JOIN char_good_bad_link gb " . "JOIN char_main n " . "ON (c.id = gb.good_id AND n.id = gb.bad_id) " . "OR (n.id = gb.good_id AND c.id = gb.bad_id)"; sql) or die(mysql_error()); if (mysql_num_rows(row = mysql_fetch_array(e[row['alias']; } foreach (key => enemies[value); } } <table><tr><td align=\"center\">No characters " . "currently exist.</td></tr></table>"; ?> <html> <head> <title>Comic Book Appreciation</title> </head> <body> <img src="CBA_Tiny.gif" align="left" hspace="10"> <h1>Comic Book<br>Appreciation</h1><br> <h3>Character Database</h3> <?php sql = "SELECT id, alias, real_name AS name, align " . "FROM char_main ORDER BY ". ord]; sql) or die(mysql_error()); if (mysql_num_rows(table = "<table border=\"0\" cellpadding=\"5\">"; <tr bgcolor=\"#FFCCCC\"><th>"; table .= "<a href=\"" . </a>"; table .= "</th><th><a href=\"" . table .= "Name</a></th><th><a href=\"" . table .= "?o=3\">Alignment</a></th><th>Powers</th>"; <th>Enemies</th></tr>"; // build each table row bg = ''; while (result)) { bg=='F2F2FF'?'E2E2F2':'F2F2FF'); powers[powers[enemies) || (row['id']]=='')) { ene = row['id']]; } <tr bgcolor=\"#" . bg . "\">" . "<td><a href=\"charedit.php?c=" . row['alias']. "</a></td><td>" . </td><td align=\"center\">" . row['align'] . "</td><td>" . </td>" . "<td align=\"center\">" . ene . "</td></tr>"; } </table>"; table = str_replace('evil', '<font color="red">evil</font>', table = str_replace('good', '<font color="darkgreen">good</font>', table; ?> <br /><a href=<charedit.php>>New Character</a> • <a href=<poweredit.php>>Edit Powers</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.