Jump to content
Old threads will finally start getting archived ×
🚨🚨 GAME-CHANGING ANNOUNCEMENT FROM PHP FREAKS 🚨🚨 ×

Perplexity 🤖

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Perplexity 🤖's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I want to search the website content of http://ubuntu.com/ with what ever is typed in the Search Term
  2. Right what if I only wanted to search the http://ubuntu.com/ that is in the example? Would that make it easier?
  3. Well I just dont understand it, it needs to be edited so instead of returning the fake results it actually return results from a webpage
  4. Morning everyone, I friend of mine has given me this script to have a look at but I cant seem to get any heads or tails of it, its a web site site search ive only ever done MYSQL searches before so any help would be greatly appreciated. index.php <?php define ("AUTHOR", "Simon"); require_once("SiteSearch.php"); $search = new SiteSearch (); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <HTML> <HEAD> <title><?=AUTHOR?></title> <link rel="stylesheet" type="text/css" href="style.css" /> </HEAD> <BODY> <div id="container"> <h2><span id="author"><?=AUTHOR?></span></h2> <form method="GET" action="<?=$_SERVER['PHP_SELF']?>"> <div id="searchBox"> <table id="searchDetails"> <tr><td>Search Term</td><td><input class="text" name="term" type="text" value="contribute" /></td></tr> <tr><td>Website</td><td><input class="text" name="url" type="text" value="http://ubuntu.com/" /></td></tr> <tr><td>Search Depth</td><td><select name="depth"> <option value="1">1</option> <option value="2" selected>2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select></td></tr> </table> <input type="submit" value="start search" /> </div> </form> <?php $results = $search->returnResults(); ?> <h2>Showing <?=count($results)?> results</h2> <div id="resultsBox"> <?php foreach ($results as $result) { ?> <div id="result"> <h3 class="title"><?=$result['title']?></h3> <em class="date"><?=$result['date']?></em> <p class="desc"><?=$result['content']?></p> <span class="url"><?=$result['url']?></span> </div> <?php } ?> </div> </div> </BODY> </HTML> SiteSearch.php class SiteSearch { public function setUrl ($url) { } public function setTerm ($search) { } public function returnResults () { $result = array(); /* Fake Results */ for ($i=0; $i<10; $i++) $result[$i] = array ( "title" => ($i+1).": Example Page Title", "date" => "Date Found: 15.08.06 17:17:23", "content" => "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed turpis. In mattis aliquet felis. Nunc sagittis urna ac felis. Phasellus sed <span class=\"exactMatch\">contribute</span> velit. Donec orci sem, tempus pharetra, fermentum nec, pellentesque vitae, massa.", "url" => "http://example.domain.com/url" ); return $result; } } ?>
  5. hhmmm just a quick question, if I use this method of writing to an XML file what would happen if more than one person was using it at the same time? Surly the results would get mixed up at the least if not showing one person another persons enquiry?
  6. Thanks guys I shall have a look at your suggestions
  7. Morning, I have been asked by my company to make a PHP calculator that shows the results in a chart/graph view, is this at all possible? I have had a look around the net and all I can find is if I want to use information from a database or XML file. Whereas I want one that creates one of the fly, I am not after a calculator in the sense of a casio styled one, just one that takes the users entered information (like a mortgage quote) and will show them the interest etc rate over X years in a graph format. Anyone know any tutorials out there that can help me? All help is much appreciated in advance
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.