help me, how to find text on an external html site using PHP


Posted on 16th Feb 2014 07:03 pm by admin

Would anyone know how to search an external html file for a work or phrase ?

I was thinking something like this --
I use script cURL...

Code: <?php
if (isset($_POST['submitted'])) {

$xurl_1 = $_POST['url_1'];
$xtext_1 = $_POST['text_1'];

function check_1($url_1, $text_1){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url_1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result=curl_exec ($ch);
curl_close ($ch);

preg_match ("|<[pP]>".$text_1."</[pP]>|i", $result, $matches);

if (count($matches)>0){
$i=true;
}else{
$i=false;
}
return $i;
}

if(check_1( $xurl_1, $xtext_1)){
echo "Text found";
}else{
echo "Text not found";
}

} else {
?>

<h3>Link Verifier</h3>
<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
<p><b>URL :</b> <input type="text" name="url_1" size="30" value="" /></p>
<p><b> Exist :</b> <input type="text" name="text_1" size="30" value="" /></p>
<div align="center"><input type="submit" name="submit" value="Check" /></div>
<input type="hidden" name="submitted" value="TRUE" />
</form>
<?php
}
?>

Unfortunently, that doesn't work..

it say:
Quote"Fatal error: Call to undefined function curl_init() in /home/*/*/new.php on line 8"

how to install cURL on windows?

164 Like 34 Dislike
Previous php-forum Next php-forum
Other php-forum

insert quotes
Hi,

I have an output like this:
Code: john,18,Cancer
How can I change this to
Code:

Getting rid of quotes when printing data
Hi Guys, I use the filter_var FILTER_SANITIZE_STRING to filter the textarea input. The function esca

Adding meta tags under Zend FW
Hello there, recently has come to my hands the FTP of a website which is running under Zend, I would

Help With editting and deleting form
Hallo !!

So look at this image :

http://img194.imageshack.us/img194/8272/snapshot5f.pn

What's wrong with my code
sobbing for many days, still don't know why please Help. Why my page isn't posted correctly. In a

MVC - Code review
I'm in the process of trying to wrap my head around MVC, and as part of that, I'm attempting to impl

Protecting forms
Alright, I want to protect some forms of mine from SQL Injections, because I had someone earlier spa

Filename like the user name
I am creating a form and storing the values in file. Could anyone please tell me how to write a code

Simple Variable Question
Hi everyone.... again,

I am really getting into php still. Learning more every day. I love it

quick question
Hi ..

i have a question
how do i set a var so it displays via an echo
Code: $logo = '&a

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash