Page 1 of 1

[SOLVED] including a file into a variable...

Posted: Tue Aug 10, 2004 11:52 am
by batfastad
OK here's a quick question...

I have an HTML file which is on our database server at http://db.domain.com:575/query?-db=data ... ml&-update

That returns a number on to an html page. At the moment in my PHP scripts I can include this to display that number on my site.

Though for this specific task I need to get this number into a variable.

I'm assuming it's not as simple as just going...

Code: Select all

<?php

$var = include("http://db.domain.com:575/query?-db=data&-format=recordcount.html&-update");

?>
Any ideas?

Thanks

Posted: Tue Aug 10, 2004 12:29 pm
by markl999
Try:

Code: Select all

$var = file_get_contents('http://db.domain.com:575/query?-db=data&-format=recordcount.html&-update');

Posted: Tue Aug 10, 2004 12:46 pm
by batfastad
Excellent!

Thanks for your fast reply!