Jump to content

Recommended Posts

Wow, that's a REALLY broad question.  I would start by reading all information available on whatever code you would like to use to do that.  If it were me, and I've never even considered how to build one until two seconds ago, I would create a database that uses php to log all content in one's source file and do some checks that way.

 

You'd have to use scripts that check the header of the file and then check their file based on what type of header they are using.  Basically check their content against that header's library of acceptable scripts and see if they match.

Link to comment
https://forums.phpfreaks.com/topic/160296-curl/#findComment-845924
Share on other sites

'm not sure if fopen has the functionality I need it to have but I've never had a reason to use Curl so its a bit like argh!

 

But basically I want to open the supplied URL check it has certain elements and how many of each and give a score at the end of it. I wouldnt really want to store the users data cos of protection etc but I guess I'm going to need a copy of it somewhere to referance and read would probably be faster and sue less bandwidth too.

 

Dunno fopen? or curl? lol

Link to comment
https://forums.phpfreaks.com/topic/160296-curl/#findComment-846306
Share on other sites

An example for you:

 

<?php
ini_set('user_agent', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; da; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10');
$url = 'http://google.com/';
$source = file_get_contents($url);
$count = preg_match_all('~<div[^>]*>~i', $source);
echo "$count div elements were found on $url";
?>

Link to comment
https://forums.phpfreaks.com/topic/160296-curl/#findComment-847159
Share on other sites

fopen wont do as you can't check reponse headers with it an if it really is similar to the w3c service you'll want to know the headers as well as sending an UTF-8 header eliminates the need for a meta tag (Unless you're using IE!).. or at least I think it was, been using the meta anyways for IE.

Link to comment
https://forums.phpfreaks.com/topic/160296-curl/#findComment-847216
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.