ldigital Posted February 1, 2013 Share Posted February 1, 2013 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! Link to comment https://forums.phpfreaks.com/topic/273924-php-file-to-check-for-text-run-command-if-its-found/ Share on other sites More sharing options...
TuQuoQueBrute Posted February 1, 2013 Share Posted February 1, 2013 <?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 Link to comment https://forums.phpfreaks.com/topic/273924-php-file-to-check-for-text-run-command-if-its-found/#findComment-1409590 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.