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

Link to comment
Share on other sites

<?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

Edited by TuQuoQueBrute
Link to comment
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.