I am trying to get the value of javascript pop-up after using file_get_contents.
<?php
$word = 'delete';
$page_content = file_get_contents($url);
if(strstr($page_content, $word)):
$result = 'YES';
else:
$result = 'NO';
endif;
?>
my code detect if there is sepecific word in the page. However, it fails to get value on javascript pop-up.
Let’s assume that there is a website which has a javascript pop-up.
file_get_contents($the_website_url) will only get html data of the website.
I am trying to get javascript pop-up value too by using php script.
Is there a way to get javascript value of external web page?
It is complicated at best, impossible otherwise.
If the popup is being generated from an external javascript resource, you may be able to parse the contents of loading the URL and load the javascript files that it references, checking each of them.
It is possible, however, that the text is either from the user, or from a dynamic load after the fact, which would make it prohibitively difficult for you to parse out.