Tutorial: Quickfinder-Include
This include retrieves all pages with filled in “quickfinder” field and displays them in dropdown box for quick selection.
You can see, that the form target is “index.php” and a page is selected with the parameter “id”, so we don’t use any smartUrl features here, just a plain direct call.
<?php class PhenotypeInclude_11 extends PhenotypeInclude { // Quickfinder public $id = 11; function display() { global $myDB; $sql = "SELECT pag_id, pag_quickfinder FROM page WHERE pag_status = 1 AND pag_quickfinder <> '' ORDER BY pag_quickfinder"; $rs = $myDB->query($sql); $options = ""; while ($row = mysql_fetch_array($rs)) { $options .= '<option value="'.$row["pag_id"].'">'.codeH($row["pag_quickfinder"]).'</option>'; } ?> <form action="index.php" method="POST"> <select name="id"> <?php echo $options?> </select> <input type="submit" value="Go"> </form> <?php } }
You think Phenotype Wiki/Documentation could be better?
We too. Please contribute: Edit this page
Recent Blog Posts
- Finally Multibyte - Phenotype 3.0
- Phenotype 2.9 explained
- Integration of PHPIDS (PHP-Intrusion Detection System)
- New Release: Phenotype 2.8 Ready for Download
- Restart: New Phenotype Website Live
- Phenotype worth: 2 Million $
- New Feature: Automatic Image Version Creation
- Additional smartURL variable: smartPATH