Jump to content

PHP File To Check For Text & Run Command If Its Found


ldigital

Recommended Posts

Hi,

 

I am working on a PHP file and need it to open a URL and if there is a certain word or phrase on the web page then open a second URL. If the text is not there, then I need the first URL to continually open until the text is found.

 

I would imagine this is pretty simple, something like an IF statement and a loop somewhere. But how do I do this?

 

Any help would be greatly appreciated! clear.png

<?php

while( 1 == 1 );{

$word=blablabla;

$aa=get_file_contents('http://blablaurl.com/bla.bla')

if (strstr($aa, "$word") == True) { echo Word found ;

get_file_contents('http://blablablaSecondUrl');

exit();

}else{

}

}

?>

 

Hey this is air code i hope that this is not wrong im not shure if the loop (while()) will work .

set the $word var to the text that you want to find

set the http://blablaurl.com/bla.bla to the page that you want to find the text

set http://blablablaSeco...laSecondUrl to the second url

if the while loop dont work try other syntaxe or Do while

Or try to figure it out :P

Archived

This topic is now archived and is closed to further replies.

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