Jump to content

Recommended Posts

Hi guys and girls,

 

I'm trying to create a php script that will search a specific website for keywords I've entered. Essentially, I'm trying to make a page that has two text inputs:

1. website URL

2. keywords

And naturally then a search button. When the search button is clicked, the entered URL will be searched for the keywords that were provided.

 

I'm pretty new to PHP and this seems a bit beyond me.

Link to comment
https://forums.phpfreaks.com/topic/268496-searching-specific-websites/
Share on other sites

You'd want to use cURL or file_get_contents to download the source for the URL entered.  Once you have the source in a string, searching it depends on how advanced of a search you want to do.  strpos would allow you do a quick and simplistic search.

Thanks a lot for your help! I'm essentially trying to create a website that searches specific news sites for issues I'm interested in.

The keywords would be related to one specific issue and the output would be links to articles on that site mentioning that interest.

 

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.