Hi all

I am having a few problems retrieving URLs from within PHP. I am using the
following to get the URL

<?

$lines = file($URL);

foreach ($lines as $line_num => $line) {
        echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) .
"<br>\n";
}
?>

It works fine even for .htaccess protect areas unless I need to change ports
i.e I need to get some data from a server on port 81 instead of port 80. I
get the following back from the script. The second warning I'm fine with as
there is obviously nothing coming back, but the first has got me stumped.
Any ideas?

(I've masked the URL)

Warning: file("http://www.xxxxxx.uk:81/";) - Success in
/home/sites/site70/users/afrench/web/get_test.php on line 3

Warning: Invalid argument supplied for foreach() in
/home/sites/site70/users/afrench/web/get_test.php on line 5

The server is a cobalt with PHP v4.1.2

Thanks

Alastair French


==============================================================================
IMPORTANT NOTICE

The information contained in this e-mail is confidential. It may also
be legally privileged. It is intended only for the stated
addressee(s) and access to it by any other person is unauthorised. If
you are not an addressee, you must not disclose, copy, circulate or
in any other way use or rely on the information contained in this
e-mail. Such unauthorised use may be unlawful.

If you have received this e-mail in error, please inform
Racal Instruments Ltd. immediately by emailing
[EMAIL PROTECTED] or phoning +44 (0)1628 604455 (ask
for the I.T. Dept.) and delete it and all copies from your system.

www.racalinstruments.com

==============================================================================


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to