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?
No comments posted yet
Your Answer:
Login to answer
164
34
Other forums
File upload issues
Hi Guys,
Can anyone see any issues with this code:
Code: [Select]$setImage= 'productimages
PHP and MySQL Question/Help
I have a MySQL db with all my servers and all their details like server name, IP, OS, RAM etc etc 26
ClientScript.RegisterClientScriptBlock Issue
This is what I haveview plaincopy to clipboardprint?Protected Sub posrback_Click(ByVal sender As Obj
Help with php code
Hello, can anyone tell me why this php word trap fails to work,
and the trigger words get blow r
how to load php class from another domain?
how to load php class from another domain?
How can I Compare two xml documents?
Hi all,
I am doing a POC for my project and I am using XE database 10g version.
How to show a complete textarea ??
I enter Client Case Notes notes in a textarea field on a PHP form. The field is 5 rows deep and 70 c
Sending CC Info by email
I am a little bit less knowledgable in the security area as most developers and I know I have a lot
Ignore html and bbcode?
I've created a function to limit the amount of text according to the amount of words.
However
Reading Most Recent CSV File in Directory
I thought I had wrapped this project up, but found out that the program I use to FTP a csv file to m