Jump to content

php web spider/bot


matthew9090

Recommended Posts

i am making a search engine and i need help because i need it so you submit your url then it automatically scrolls it for the description and keywords then puts it in the database. my html code:

 

<form action="submit_url.php" method="get">
<input type="text" name="url" value="url" />
<input type="submit" name="submit" value="submit" />
</form>

 

php code so far:

 

<html>
<head>
<title>submitting url: <?php $url = $_GET['url']; echo $url; ?></title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>

<?php
echo "Submitting <b>$url</b>";

$url = fopen("http://knexideas.co.cc", "r") or exit("Unable to open");
while (!feof($url))
  {
  fgetc($url);
  }
fclose($url);


?>
</body>
</html> 

 

all it does is reads the website if you put 'echo $url' at the bottom it just reads and prints the web page.

Link to comment
Share on other sites

if you need to parse an HTML page, it's probably worth looking at simplehtmldom, which makes the process much much easier: http://simplehtmldom.sourceforge.net/

 

it comes up with an error for this line:

$html = file_get_html('http://www.google.com/');

 

Fatal error: Call to undefined function file_get_html() in C:\wamp\www\usearch\submit_url.php on line 12

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.