Menu
i need help on building search engine that can integrate information from other search engine.please help me…
[code=php]
<?php
if(!isset($_GET['q']) || empty($_GET['q']))
{
echo <<<form
<form action="{$_SERVER['REQUEST_URI']}" method="get">
<input type="text" name="q">
<input type="submit" name="submit" value="Search">
</form>
form;
}
else
{
echo readfile("http://citeseer.ist.psu.edu/cis?q={$_GET['q']}");
}
?>
[/code]
[code=php]
<?php
if(!isset($_GET['q']) || empty($_GET['q']))
{
$self = $HTTP_GET_VARS['PHP_SELF'];
echo "<form action="$self" method="get">n<input type="text" name="q">n<input type="submit" name="submit" value="Search">n</form>n";
}
else
{
$q = $HTTP_GET_VARS['q'];
echo readfile("http://citeseer.ist.psu.edu/cis?q=$q");
}
?> [/code]
[code=php]
<?php
if(!isset($_GET['q']) || empty($_GET['q']))
{
echo "<form action="{$_SERVER['PHP_SELF']}" method="get">n<input type="text" name="q">n<input type="submit" name="submit" value="Search">n</form>n";
}
else
{
$q = str_replace(' ', '+', $_GET['q']);
echo readfile("http://citeseer.ist.psu.edu/cis?q=$q");
}
?>[/code]
$connection = mysql_connect('localhost','','') or die("Could not connect to MySQL " .mysql_error() );
$selection = mysql_select_db("db_cosrep") or die("Unable to select database. " .mysql_error());
$submit = $_POST["submit"];
$q = $_POST["q"];
if($submit == "Search >>")
{
$choice1=$_POST["choice1"];
if($choice1=="cosrep")
{
if(isset($_POST["q"]))
{
// create the query
$sql = "SELECT * FROM php_directory WHERE title LIKE '%$q%' ";
// execute query
$result = mysql_query($sql) or die("SQL select statement failed");
// retrieves a row data and returns it as an associative array
while ($row=mysql_fetch_array($result))
{
// display direct from array
echo "<table><tr width=100%>";
echo "<td width=80%><a target='_blank' href=$row[url1]><u>$row[title]</u></a></td><td width=20%>percentage</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=80%>$row[abstract]</td><td width=20%>$row[publishon]</td></tr>";
echo "<tr>";
echo "<td width=80%>$row[url]</td><td width=20%></td>";
echo "</tr></table>";
echo "<hr>";
}
}
}
if($choice1=="cosrepNciteseer")
{
$self = $HTTP_GET_VARS['PHP_SELF'];
$q = str_replace(' ', '+', $_GET['q']);
echo readfile("http://citeseer.ist.psu.edu/cis?q=$q");
}
}
[code=php]
<?php
$connection = mysql_connect('localhost','','') or die("Could not connect to MySQL " .mysql_error());
$selection = mysql_select_db('db_cosrep') or die("Unable to select database. " .mysql_error());
$submit = $_POST['submit'];
if($submit == "Search >>")
{
if(!isset($_POST['choice1']))
{
// found error
exit('DEBUG: choice1 not set!');
}
$choice1 = $_POST['choice1'];
if($choice1 == "cosrep")
{
if(isset($_POST['q']))
{
$q = $_POST['q'];
// create the query
$sql = "SELECT * FROM php_directory WHERE title LIKE '%$q%' ";
// execute query
$result = mysql_query($sql) or die("SQL select statement failed");
// retrieves a row data and returns it as an associative array
while ($row=mysql_fetch_array($result))
{
// display direct from array
echo "<table><tr width=100%>";
echo "<td width=80%><a target='_blank' href=$row[url1]><u>$row[title]</u></a></td><td width=20%>percentage</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=80%>$row[abstract]</td><td width=20%>$row[publishon]</td></tr>";
echo "<tr>";
echo "<td width=80%>$row[url]</td><td width=20%></td>";
echo "</tr></table>";
echo "<hr>";
}
}
}
elseif($choice1 == "cosrepNciteseer")
{
$q = str_replace(' ', '+', $_POST['q']);
echo readfile("http://citeseer.ist.psu.edu/cis?q=$q");
}
}
?>[/code]
[code=php]
<?php
$connection = mysql_connect('localhost','','') or die("Could not connect to MySQL " .mysql_error());
$selection = mysql_select_db('db_cosrep') or die("Unable to select database. " .mysql_error());
$submit = $_POST['submit'];
if($submit == "Search >>")
{
if(!isset($_POST['choice1']))
{
// found error
exit('DEBUG: $_POST['choice1'] not set.');
}
$choice1 = $_POST['choice1'];
if($choice1 == "cosrep")
{
if(isset($_POST['q']))
{
$q = $_POST['q'];
// create the query
$sql = "SELECT * FROM php_directory WHERE title LIKE '%$q%' ";
// execute query
$result = mysql_query($sql) or die("SQL select statement failed");
// retrieves a row data and returns it as an associative array
while ($row = mysql_fetch_array($result))
{
// display direct from array
echo "<table><tr width=100%>";
echo "<td width=80%><a target='_blank' href=$row[url1]><u>$row[title]</u></a></td><td width=20%>percentage</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=80%>$row[abstract]</td><td width=20%>$row[publishon]</td></tr>";
echo "<tr>";
echo "<td width=80%>$row[url]</td><td width=20%></td>";
echo "</tr></table>";
echo "<hr>";
}
}
else
{
// found error
exit('DEBUG: $_POST['q'] not set.');
}
}
elseif($choice1 == "cosrepNciteseer")
{
$q = str_replace(' ', '+', $_POST['q']);
echo readfile("http://citeseer.ist.psu.edu/cis?q=$q");
}
else
{
// found error
exit('DEBUG: $choice1 value not "cosrep" or "cosrepNciteseer".');
}
}
else
{
// found error
exit('DEBUG: $submit not equal to "Search >>".');
}
?> [/code]
<body>
<form method="post" action="main5.php" target="mainFrame" >
<div style="position: absolute; width: 203px; height: 29px; z-index: 1; left: 476px; top: 57px" id="layer1">
<img src=pbc.bmp></div>
<p align="center" style="line-height: 150%">
<input type="text" name="q" size=40>
<input type="submit" name="submit" value="Search >>">
</p>
<p align="center" style="line-height: 150%">
<font size="4" face="Times New Roman">
<font size="4" face="Times New Roman">
<input type="radio" name="choice1" value="cosrep">CoSReP Only </font>
<input type="radio" name="choice1" value="cosrepNciteseer"> CoSReP + Citeseer <br>
</font><font face="Arial, Helvetica, sans-serif" size="2">
</form>
</body>
$choice1 = $_POST['choice1'];
if($choice1 == "cosrep")
{
if(isset($_POST['q']))
{
$q = $_POST['q'];
// create the query
$sql = "SELECT * FROM php_directory WHERE title LIKE '%$q%' ";
// execute query
$result = mysql_query($sql) or die("SQL select statement failed");
// retrieves a row data and returns it as an associative array
while ($row=mysql_fetch_array($result))
{
// display direct from array
echo "<table><tr width=100%>";
echo "<td width=100%><a target='_blank' href=$row[url1]><u>$row[title]</u></a></td><td width=20%>$hit</td>";
echo "</tr>";
echo "<tr>";
echo "<td width=100%>$row[abstract]</td><td width=20%>$row[publishon]</td></tr>";
echo "<tr>";
echo "<td width=100%>$row[url]</td>";
echo "</tr></table>";
echo "<hr>";
}
}
}
elseif($choice1 == "cosrepNciteseer")
{
$q = str_replace(' ', '+', $_GET['q']);
echo readfile("http://citeseer.ist.psu.edu/cis?q=$q");
}
[code=php]
echo "<td width=100%><a target='_blank' href=$row[url1]><u>$row[title]</u></a></td><td width=20%>$hit</td>";[/code]
[code=php]echo "<td width=100%>$row[abstract]</td><td width=20%>$row[publishon]</td></tr>";[/code]
[code=php]
<?php
// check that post variables exist
if(isset($_POST['submit'])) {
$choice1_list = array('cosrep', 'cosrepNciteseer');
// validate choice1 input
if(!isset($_POST['choice1']) || !in_array($_POST['choice1'], $choice1_list) {
$choice1 = $choice1_list[0];
}
else {
$choice1 = $_POST['choice1'];
}
// cleanup search query
$q = trim($_POST['q'])
if(@get_magic_quotes_gpc()) {
stripslashes($q);
}
// ensure query is not empty
if(empty($q)) {
exit('No keywords specified.');
}
// escape query to prevent sql injection attacks
$q = mysql_real_escape_string($q);
// connect and select database
mysql_connect('localhost','','') or die("Could not connect to MySQL " .mysql_error());
mysql_select_db('db_cosrep') or die("Unable to select database. " .mysql_error());
// execute query
$result = @mysql_query("SELECT * FROM php_directory WHERE title LIKE '%$q%' ");
// strip slashes for later use
$q = stripslashes($q);
if(mysql_num_rows($result) < 1) {
$no_results = true;
}
else {
while($row = mysql_fetch_assoc($result)) {
echo "<table><tr width=100%>n";
echo "<td width=100%><a target='_blank' href=$row[url1]><u>$row[title]</u></a></td><td width=20%>$row[hit]</td>n";
echo "</tr>n";
echo "<tr>n";
echo "<td width=100%>$row[abstract]</td><td width=20%>$row[publishon]</td></tr>n";
echo "<tr>n";
echo "<td width=100%>$row[url]</td>n";
echo "</tr></table>n";
echo "<hr>nn";
}
}
// if selected, display citeseer results as well
if($choice1 == $choice1_list[1])
{
// perform citeseer query
citeseer_query($q);
// if no results found, tell user
if(preg_match('<!--RLS--><!--RLE-->', $data) and $no_results) {
exit("No documents found matching: <em>$q</em>");
}
// display results of query
citeseer_results($q);
}
exit;
}
function citeseer_query($query) {
$query = str_replace(' ', '+', $query);
return readfile("http://citeseer.ist.psu.edu/cis?q=$query");
}
function citeseer_results($query) {
$results = preg_split('<!--RIS--><a href="(.*?)">(.*?)</a>nn <a href="(.*?)"><font color=#6f6f6f>(.*?)</font></a> <a href="(.*?)">((d{1,3}) citations)</a>n<br>n<font color=black>(.*?)</font><br><font color=green>(.*?)</font>n<!--RIE-->', $query)
$return = array();
foreach($results as $result) {
preg_replace('<!--RIS--><a href="(.*?)">(.*?)</a>nn <a href="(.*?)"><font color=#6f6f6f>(.*?)</font></a> <a href="(.*?)">((d{1,3}) citations)</a>n<br>n<font color=black>(.*?)</font><br><font color=green>(.*?)</font>n<!--RIE-->', "<table><tr width=100%>n<td width=100%><a target='_blank' href=\1><u>\2</u></a></td><td width=20%></td>n</tr>n<tr>n<td width=100%></td><td width=20%></td></tr>n<tr>n<td width=100%>\1</td>n</tr></table>n<hr>nn");
$return[] = $result;
}
return $return;
}
else { ?><html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<head><title>Computer Science Research Paper in malaysia</title>
<meta name="Microsoft Theme" content="copy-of-sonora11111111 1011">
<base target="main">
</head>
<body>
<form method="post" action="main5.php" target="mainFrame" >
<div style="position: absolute; width: 203px; height: 29px; z-index: 1; left: 476px; top: 57px" id="layer1">
<img src=pbc.bmp></div>
<p align="center" style="line-height: 150%">
<input type="text" name="q" size=40>
<input type="submit" name="submit" value="Search »">
</p>
<p align="center" style="line-height: 150%">
<font size="4" face="Times New Roman">
<font size="4" face="Times New Roman">
<input type="radio" name="choice1" value="cosrep">CoSReP Only </font>
<input type="radio" name="choice1" value="cosrepNciteseer"> CoSReP + Citeseer <br>
</font><font face="Arial, Helvetica, sans-serif" size="2">
</form>
</body>
</html><?php exit;
} ?>[/code]
[code=php]
<?php
// check that post variables exist
if(isset($_POST['submit'])) {
$choice1_list = array('cosrep', 'cosrepNciteseer');
// validate choice1 input
if(!isset($_POST['choice1']) || !in_array($_POST['choice1'], $choice1_list) {
$choice1 = $choice1_list[0];
}
else {
$choice1 = $_POST['choice1'];
}
// cleanup search query
$q = trim($_POST['q'])
if(@get_magic_quotes_gpc()) {
stripslashes($q);
}
// ensure query is not empty
if(empty($q)) {
exit('No keywords specified.');
}
// escape query to prevent sql injection attacks
$q = mysql_real_escape_string($q);
// connect and select database
mysql_connect('localhost','','') or die("Could not connect to MySQL " .mysql_error());
mysql_select_db('db_cosrep') or die("Unable to select database. " .mysql_error());
// execute query
$result = @mysql_query("SELECT * FROM php_directory WHERE title LIKE '%$q%' ");
// strip slashes for later use
$q = stripslashes($q);
if(mysql_num_rows($result) < 1) {
$no_results = true;
}
else {
while($row = mysql_fetch_assoc($result)) {
echo "<table><tr width=100%>n";
echo "<td width=100%><a target='_blank' href=$row[url1]><u>$row[title]</u></a></td><td width=20%>$row[hit]</td>n";
echo "</tr>n";
echo "<tr>n";
echo "<td width=100%>$row[abstract]</td><td width=20%>$row[publishon]</td></tr>n";
echo "<tr>n";
echo "<td width=100%>$row[url]</td>n";
echo "</tr></table>n";
echo "<hr>nn";
}
}
// if selected, display citeseer results as well
if($choice1 == $choice1_list[1])
{
// perform citeseer query
citeseer_query($q);
// if no results found, tell user
if(preg_match("'<!--RLS--><!--RLE-->'", $data) and $no_results) {
exit("No documents found matching: <em>$q</em>");
}
// display results of query
citeseer_results($q);
}
exit;
}
function citeseer_query($query) {
$query = str_replace(' ', '+', $query);
return readfile("http://citeseer.ist.psu.edu/cis?q=$query");
}
function citeseer_results($query) {
$results = preg_split("'<!--RIS--><a href="(.*?)">(.*?)</a>nn <a href="(.*?)"><font color=#6f6f6f>(.*?)</font></a> <a href="(.*?)">((d{1,3}) citations)</a>n<br>n<font color=black>(.*?)</font><br><font color=green>(.*?)</font>n<!--RIE-->'", $query)
$return = array();
foreach($results as $result) {
preg_replace("'<!--RIS--><a href="(.*?)">(.*?)</a>nn <a href="(.*?)"><font color=#6f6f6f>(.*?)</font></a> <a href="(.*?)">((d{1,3}) citations)</a>n<br>n<font color=black>(.*?)</font><br><font color=green>(.*?)</font>n<!--RIE-->'", "'<table><tr width=100%>n<td width=100%><a target='_blank' href=\1><u>\2</u></a></td><td width=20%></td>n</tr>n<tr>n<td width=100%></td><td width=20%></td></tr>n<tr>n<td width=100%>\1</td>n</tr></table>n<hr>nn'");
$return[] = $result;
}
return $return;
}
else { ?><html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<head><title>Computer Science Research Paper in malaysia</title>
<meta name="Microsoft Theme" content="copy-of-sonora11111111 1011">
<base target="main">
</head>
<body>
<form method="post" action="main5.php" target="mainFrame" >
<div style="position: absolute; width: 203px; height: 29px; z-index: 1; left: 476px; top: 57px" id="layer1">
<img src=pbc.bmp></div>
<p align="center" style="line-height: 150%">
<input type="text" name="q" size=40>
<input type="submit" name="submit" value="Search »">
</p>
<p align="center" style="line-height: 150%">
<font size="4" face="Times New Roman">
<font size="4" face="Times New Roman">
<input type="radio" name="choice1" value="cosrep">CoSReP Only </font>
<input type="radio" name="choice1" value="cosrepNciteseer"> CoSReP + Citeseer <br>
</font><font face="Arial, Helvetica, sans-serif" size="2">
</form>
</body>
</html><?php exit;
} ?>[/code]
if(!isset($_POST['choice1']) || !in_array($_POST['choice1'], $choice1_list) {
$choice1_list = array('cosrep', 'cosrepNciteseer');
// validate choice1 input
if(!isset($_POST['choice1']) || !in_array($_POST['choice1'], $choice1_list))
{
$choice1 = $choice1_list[0];
}
else {
$choice1 = $_POST['choice1'];
}
// cleanup search query
$q = trim($_POST['q']);
if(@get_magic_quotes_gpc())
{
stripslashes($q);
}
// ensure query is not empty
if(empty($q)) {
exit('No keywords specified.');
}
// escape query to prevent sql injection attacks
$q = mysql_real_escape_string($q);
// connect and select database
mysql_connect('localhost','','') or die("Could not connect to MySQL " .mysql_error());
mysql_select_db('db_cosrep') or die("Unable to select database. " .mysql_error());
// execute query
$result = @mysql_query("SELECT * FROM php_directory WHERE title LIKE '%$q%' ");
// strip slashes for later use
$q = stripslashes($q);
if(mysql_num_rows($result) < 1)
{
$no_results = true;
}
else
{
while($row = mysql_fetch_assoc($result))
{
echo "<table><tr width=100%>n";
echo "<td width=100%><a target='_blank' href=$row[url1]><u>$row[title]</u></a></td><td width=20%>$row[hit]</td>n";
echo "</tr>n";
echo "<tr>n";
echo "<td width=100%>$row[abstract]</td><td width=20%>$row[publishon]</td></tr>n";
echo "<tr>n";
echo "<td width=100%>$row[url]</td>n";
echo "</tr></table>n";
echo "<hr>nn";
}
}
// if selected, display citeseer results as well
if($choice1 == $choice1_list[1])
{
// perform citeseer query
citeseer_query($q);
// if no results found, tell user
if(preg_match("'<!--RLS--><!--RLE-->'", $data) and $no_results)
{
exit("No documents found matching: <em>$q</em>");
}
// display results of query
citeseer_results($q);
}
exit;
$return = array();
foreach($results as $result)
{
preg_replace("'<!--RIS--><a href="(.*?)">(.*?)</a>nn <a href="(.*?)"><font color=#6f6f6f>(.*?)</font></a> <a href="(.*?)">((d{1,3}) citations)</a>n<br>n<font color=black>(.*?)</font><br><font color=green>(.*?)</font>n<!--RIE-->'", "'<table><tr width=100%>n<td width=100%><a target='_blank' href=\1><u>\2</u></a></td><td width=20%></td>n</tr>n<tr>n<td width=100%></td><td width=20%></td></tr>n<tr>n<td width=100%>\1</td>n</tr></table>n<hr>nn'");
$return[] = $result;
}
return $return;
0.1.9 — BETA 5.17