<html><body><h1>It works! 2014</h1> <HEAD> <LINK REL="stylesheet" TYPE="text/css" HREF="styles.css" TITLE="Style"> </HEAD> execute ... <h1>Zoek naar: <?php echo $_POST["zoektext"]; ?> </h1> <form name="demo" method="post" action="index2.php"> <input type="textarea" name="zoektext"> <input type="submit" value="Feeling Lucky"> </form> <?php #echo "TEST"; #echo "<br>"; #echo "TEST2"; require_once('HTML/Table.php'); require_once ('DB.php'); $user = 'root'; $pass = ''; $host = 'localhost'; $db_name = 'cdcol'; $dsn = "mysql://$user:$pass@$host/$db_name"; $db = DB::connect($dsn); #select * from pokemon where English_Name like "B%"; $sql = "select * from cds "; if ($_GET["naam"] <> "") { $sql .= "order by ".$_GET["naam"]; if ($_GET["osort"] == 0) { $sql .= " DESC"; $osort = 1; } } echo $sql; $result = $db->query($sql); $table = new HTML_Table (Array ("border" => "1", "width" => "50%", "align" => "center")); $table->setColAttributes(0,"align=center"); $table->setColAttributes(1,"align=center"); $table->addRow(Array("<a href=index2.php?osort=$osort&naam=interpret>Interpreter</a>","<a href=index2.php?osort=$osort&naam=jahr>Year</a>")); while ($result->fetchInto($arr,DB_FETCHMODE_ORDERED)) { $table->addRow(Array("<a href='http://nl.wikipedia.org/wiki/$arr[1]'>$arr[1]</a>",$arr[2])); }; $row1Style = array("class" => "bg0"); $row2Style = array("class" => "bg1"); $table->setRowAttributes (0, "style = 'background-color: #FFFFFF; color: #000000'"); $table->altRowAttributes (1, $row1Style,$row2Style); $table->display(); #phpinfo() ?> ... ok </body></html>
You must be logged in to post a comment.