<?php require_once 'db.php'; require_once 'php-txt-db-api/txt-db-api.php'; require_once 'printUtils.php'; $learningPath = $_REQUEST['lpath']; if (!isset($learningPath)) { die; } // expecting array of "pageid|flag" // strip flags $lps = array(); foreach ($learningPath as $page) { $el = explode('|', $page); $lps[] = $el[0]; } $r = driverdb_getSimilarLPs($lps, $result, $equal); $same = isset($equal) ? 1 : 0; print $r . ',' . $same . "<count>"; // for now, just print the number of lps found... $tagset = array(); $result = buildSearchResultsPrintOut($result, $tagset, false, false, $equal); //print print_r($result,true); /* $f = fopen('lps.txt','a'); $content = print_r($learningPath,true); //$content .= print_r($tags,true); fwrite($f,$content,strlen($content)); fclose($f); */
<h1> Searching for a Learning Path... </h1></td><td valign=bottom></td></tr></table> <hr> <div> <form> <label for="tags">Tags: </label> <input id="tags" name="tags" size="50" /> <input id="searchButton" type="submit" value="Search"/> </form> </div> <hr> <table><tr><td width=100% style="vertical-align:top"> <div id="searchResults"> <?php //print p_render('xhtml',p_get_instructions('[[newpage]]'),$info); if (!isset($_REQUEST['tags'])) { print "no results yet..."; } else { $tags = $_REQUEST['tags']; print '<h3>Search results for "' . trim($tags) . '"</h3>'; $tagset = explode(' ', trim($tags)); //buildSearchResultsPrintOut(driverdb_searchLPs($tagset),$tagset,true,true,0,'','onPreviewPage'); buildSearchResultsPrintOut(driverdb_searchLPs($tagset), $tagset, true, true, 0, '', 'onPreviewPage', true); } ?> </div> </td></tr></table> <br clear="both" /> </div> </body> </html>