/    Sign up×
Community /Pin to ProfileBookmark

i need help on building search engine that can integrate information from other search engine.please help me…

to post a comment
SEO

42 Comments(s)

Copy linkTweet thisAlerts:
@pcthugAug 01.2006 — Whom is the [I]other search engine[/I]? Do you have access to this search engine's database, etc?
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 01.2006 — that is the problem...i need to integrate data from citeseer n obviously...i dont have the access to its database..can u help me?i need to make it like google...search into other search engine, merge the results.
Copy linkTweet thisAlerts:
@pcthugAug 01.2006 — When you speak of [I]citeseer[/I], are you referring to [url=http://citeseer.ist.psu.edu]The scientific literature digital library[/url]?
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 01.2006 — yes...u r correct.that citeseer.can u help me?to retrieve the data from citeseer?
Copy linkTweet thisAlerts:
@pcthugAug 01.2006 — As the site uses the GET method of data encoding you could pass your query as

http://citeseer.ist.psu.edu/cis?q=<query>

include various other parameters (i.e. cs=). Then you would read the dynamically created page, focusing and extracting the results. This extracting process would simply read all results into a local format which you could then redisplay and reformat yourself.

Please note: Such replication may infringe certain copyright laws and therefore should not be practiced without strict permission from the site owner or collectively Citeseer.
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 01.2006 — sorry..i didnt get that.i mean...where to put the "http://citeseer.ist.psu.edu/cis?q=<query>" in my codes?im really stuck here
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 01.2006 — what is cs stands for?is it really just like that?ive try everything,but still cannot send my query to citeseer.
Copy linkTweet thisAlerts:
@pcthugAug 01.2006 — Ok, firstly: What (if any) server-side technologies (PHP, ASP, JAVA, CGI-PERL, ColdFusion, etc.) do you have available to you?
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 01.2006 — im using php..
Copy linkTweet thisAlerts:
@pcthugAug 01.2006 — Try this little php script:
[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]
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 01.2006 — while implementing this scripts,an error occured on line 5 (echo <<<form ) and line 10(form).y?n how to solve it?
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 01.2006 — the form tag cannot be inside the php scripts..how 2 solve this?
Copy linkTweet thisAlerts:
@pcthugAug 01.2006 — For such an error to be trigged I am led to believe that you do not have Heredoc syntax support ad therefore are running on an ancient version of PHP (like < version 4), try this script instead:
[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]
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 01.2006 — new problem exists

Warning: readfile("http://citeseer.ist.psu.edu/cis?q=information integration") - No error in c:apachehtdocscari.php on line 12

Fatal error: Maximum execution time of 30 seconds exceeded in c:apachehtdocscari.php on line 12
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 02.2006 — i know now why the problem exists.it is because there's a space between the keywords, such as "information integration".it can onlys earch for one words not many words coz it cant read space.how to overcome this?
Copy linkTweet thisAlerts:
@pcthugAug 02.2006 — Try:
[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]
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 02.2006 — got it...thanx a lot
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 03.2006 — [B]this is my code.the part of searching my database is done.the other part which is searching to citeseer encounter small problems.can u fix it?[/B]

<?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"];
$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");

}
}

?>
Copy linkTweet thisAlerts:
@pcthugAug 03.2006 — Try this:[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]
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 03.2006 — the code has no error but display nothing.y?
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 03.2006 — it want to display.but suddenly it goes to blank page.not citeseer result page
Copy linkTweet thisAlerts:
@pcthugAug 03.2006 — Ok then, run this:
[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]
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 04.2006 — the codes goes to blank page.at 1st..it does display the citeseer result page,but after 5 secs it goes to blank page.
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 04.2006 — i need to display the result on the same page of my database search result
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 04.2006 — perhaps the readfile code?
Copy linkTweet thisAlerts:
@pcthugAug 04.2006 — So where would you like the citeseer results to appear? Under your database results, above? If so, what is the use of $choice1? Please Explain.
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 06.2006 — there is 2 radio button.1 is to search from my database only(its easy n its done).the 2nd is search to citeseer n my database together,then combine the results(form search to citeseer n my database) rank it n then display the result.how to do it then?can u help me?
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 06.2006 — [B]this is my form page source code..[/B]

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com?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> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<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 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font>
<input type="radio" name="choice1" value="cosrepNciteseer">&nbsp;CoSReP + Citeseer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br>
</font><font face="Arial, Helvetica, sans-serif" size="2">


</form>



</body>

</html>


[B]while this is my action page....the results need to be display on this page...[/B]

<?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=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");

}

}

?>

[B]for the cosrep n cieseer radio button...it should be able to search to my own database n citeseer,rank the results n display it..how to do it?[/B]
Copy linkTweet thisAlerts:
@pcthugAug 06.2006 — To rank the results some type of algorithm must be used, this algorithm could easily be used with just your results - however when combining 2 sets of results (one of which we can't access directly) accurate ranking becomes near impossible.
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 06.2006 — if i cant rank the result,at least i could combine the search result.thats all i need to do for now.can u help me?maybe,i could retrieve the result from citeseer and save it to my database or something.for at least i could combine the search result.
Copy linkTweet thisAlerts:
@pcthugAug 06.2006 — What is the value of $hit:
[code=php]
echo "<td width=100%><a target='_blank' href=$row[url1]><u>$row[title]</u></a></td><td width=20%>$hit</td>";[/code]
Copy linkTweet thisAlerts:
@pcthugAug 06.2006 — And $row['abstract'] and $row['publishon']?
[code=php]echo "<td width=100%>$row[abstract]</td><td width=20%>$row[publishon]</td></tr>";[/code]
The reason I ask is because I'm trying to format the citeseer results the same as your database results and i'm not sure where to get this information from.
Copy linkTweet thisAlerts:
@pcthugAug 06.2006 — So far I have this (Not Tested):
[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&nbsp; <a href="(.*?)"><font color=#6f6f6f>(.*?)</font></a> &nbsp; <a href="(.*?)">((d{1,3})&nbsp;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&nbsp; <a href="(.*?)"><font color=#6f6f6f>(.*?)</font></a> &nbsp; <a href="(.*?)">((d{1,3})&nbsp;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> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" name="submit" value="Search &raquo;">
</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 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font>
<input type="radio" name="choice1" value="cosrepNciteseer">&nbsp;CoSReP + Citeseer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br>
</font><font face="Arial, Helvetica, sans-serif" size="2">


</form>



</body>
</html><?php exit;
} ?>[/code]
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 06.2006 — never mind about $hit

$abstract is the abstract of the paper

$publishon is the date the paper is published

i really thank u for ur help
Copy linkTweet thisAlerts:
@pcthugAug 06.2006 — Ok then, well from the citeseer database I only have The link URL, Document title, Correctness, Number of Citations, A short description of the document and it's original source. From this information what should I substitute $abstract and $publishion with? Currently they are simply being left blank:
[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&nbsp; <a href="(.*?)"><font color=#6f6f6f>(.*?)</font></a> &nbsp; <a href="(.*?)">((d{1,3})&nbsp;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&nbsp; <a href="(.*?)"><font color=#6f6f6f>(.*?)</font></a> &nbsp; <a href="(.*?)">((d{1,3})&nbsp;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> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" name="submit" value="Search &raquo;">
</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 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font>
<input type="radio" name="choice1" value="cosrepNciteseer">&nbsp;CoSReP + Citeseer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br>
</font><font face="Arial, Helvetica, sans-serif" size="2">


</form>



</body>
</html><?php exit;
} ?>[/code]
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 08.2006 — abstract is the short description of the document(on citeseer),while publishon should be the date that document is published.left it behind,i still cant think wut to replace.
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 08.2006 — ive tried the code u gave me...it has error on line 9;

if(!isset($_POST['choice1']) || !in_array($_POST['choice1'], $choice1_list) {
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 10.2006 — [B]ive overcome the error..now,exists new error n i really need ur help.please help me.



this is ur code that ive edited...[/B]


<?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&nbsp; <a href="(.*?)"><font color=#6f6f6f>(.*?)</font></a> &nbsp; <a href="(.*?)">((d{1,3})&nbsp;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&nbsp; <a href="(.*?)"><font color=#6f6f6f>(.*?)</font></a> &nbsp; <a href="(.*?)">((d{1,3})&nbsp;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;

}

?>

<?php exit; ?>

[B]n it has error that says:[/B]

Fatal error: Call to undefined function: mysql_real_escape_string() in c:apachehtdocscosrepmalmain5.php on line 31

[B]please sir,i really need your help[/B]
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 13.2006 — every problems has been settled.thanx to you sir...

lastly...there only exist 1 single problem...it do display the result...but suddenly,it goes blank.why is that happen?i guess because of the readfile function.

how to overcome this?
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 19.2006 — how do i save all the information i grab from citeseer in my database?please...i really need ur help
Copy linkTweet thisAlerts:
@pcthugAug 20.2006 — Why do you need to [I]spider[/I] the citeseer database? Couldn't you just display the relative query?
Copy linkTweet thisAlerts:
@harita_hadrawauthorAug 20.2006 — i need to integrated the result between citeseer result n my database result.that is y i need to save all those queried results into my database.besides,the readfile function display all the results page including citeseer search input box.plz,i really need ur help.
×

Success!

Help @harita_hadraw spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...