Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = $_POST['un'];
- $password = $_POST['unb'];
- $usernameinreverse = strrev($username);
- if ($usernameinreverse == $password) {
- echo "good";
- } else {
- echo "nope";
- exit("bad pass");
- }
- ?>
- <html><head><title>Display Books</title></head>
- <body>
- <h1>Display all Titles</h1>
- <table border=9>
- <tr><th><a href="u.php?view=category">Category</th><th><a href="u.php?view=title">Title</th><th><a href="u.php?view=author">Author</th><th><a href="u.php?view=publisher">Publisher</th><th><a href="u.php?view=price">Price</th><th><a href="u.php?view=isbn">ISBN</th></tr>
- <?php
- include_once "books2.php";
- $getcat = $_GET["category"];
- echo $getcat;
- $getview = $_GET["view"];
- echo $getview;
- $array = $books;
- //print_r(array_values($array));
- //print_r(array_keys($array, $getcat));
- //$key = array_search("Business", $array);
- //print_r(array_values($array));
- //echo $key;
- //print_r(array_filter($array, "Nonfiction"));
- //array_filter($array, function($a) { return $a['category'] == 'Business'; });
- //array_filter($array, function($a) { return $a['category'] == 'Business'; });
- function type($boop)
- {
- return $boop['category'] == $getcat;
- }
- print_r(array_filter($array, "type"));
- foreach ($books as $key => $row)
- $mrsort[$key] = $row[$getview];
- array_multisort($mrsort, SORT_DESC, $books);
- foreach ($books as $book):
- ?>
- <tr><td> <a href="u.php?category=<?php echo $book['category'];?>"> <?php echo $book['category'];?> </a> </td>
- <td> <?php echo $book['title'];?> </td>
- <td> <?php echo $book['author'];?> </td>
- <td> <?php echo $book['publisher'];?> </td>
- <td align=right> <?php echo $book['price'];?> </td>
- <td> <a href=cart.php?isbn=<?php echo $book['isbn'];?>>Add to Cart</a></td>
- </tr>
- <?php
- endforeach;
- ?>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement