I want to extract the version number of a webserver. the version number is showed on the admin login page.

i tried this:

$content = file_get_contents('URL/login.jsp');

preg_match("/<div class=\"product-version\".*div>/", $content);

echo "content: $content";

It does show the version number but also a large part of the rest of the page.

part of the page i want to have preg_match look in:

<div class="product-logo" style="background-image:url(images/product/icon-system-admin.png)">
<div class="product-version">10.3</div>

Is this possible? or to edit the preg_match to just use the 4 characters after product-version is found?

1 Answers

shadi1989 On

@Toto that solved it, thanks!

Next thing is to get this working for a bunch of urls. Want to have the script read urlcustomers.txt in the same directory and show all the version of the webserver for each customer in a table.