On pressing the submit button, I want the PHP code to check to see if a string exists within a webpage on another website.
$random = rand(100,1000);
strpos(file_get_contents('website.com/url.php?username='.$username), $random);
So, until the code has managed to find the value of $random, it won't continue with the rest of the script. The updates can take about 10 seconds.
I have tried a while script:
$random = rand(100,1000);
echo '<div data-alert class="alert-box alert">'.$random.'</div>';
$key = false;
while($key){
if(strpos(file_get_contents('website.com/url.php?username='.$username), $random)) $key = true;
}
This doesn't seem to work.