Evo ti skripte:
Code:
<?php
// file: unesi.php
$url = $_REQUEST['url'];
require("config.php"); // ovo je fajl za mysql konekciju
$meta = get_meta_tags($url);
$autor = $meta['author'];
$keywords = $meta['keywords'];
$opis = $meta['description'];
mysql_query("INSERT INTO ws VALUES(null,'$url','$autor','$keywords','$opis')") or die("Query error: ".mysql_error());
echo "Site inserted!";
//---------------------------------
?>
E sad fajl trazi.php
Code:
<?php
$keyword = $_REQUEST['keyword'];
require("config.php");
$q = mysql_query("SELECT * FROM ws WHERE keywords LIKE '$keyword'") or die("Query failed: ".mysql_error());
while($r = mysql_fetch_array($q)) {
echo "<a href='".$r['url']."' target='_blank'>".$r['url']."</a> - WebMaster: ".$r['autor']." <br /> ".$r['opis']." <br /><hr width='200' />";
}
?>
Code sam sad pisao pa ispravi ako negdje ima neki bug.
Uzivaj!