Opening remote fie

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all!
I want to open/execute a remote php file and get its result in a variable and
then to parse it. I use fopen and fread. My problem is that $filename doesn't
accept arguments. Code is as under:
<?
$filename = "http://a_remote_host.com/my_file.php?arg1=value1&arg2=value2";;
fopen($filename, "r"); 
$contents = fread($handle, filesize($filename));
?>
It shows the followings:
Warning: fopen(): php_network_getaddresses: gethostbyname failed in
c:\apache\htdocs\search\action.php on line 3

Warning: fopen(http://a_remote_host.com/my_file.php?arg1=value1&arg2=value2):
failed to open stream: Invalid argument in c:\apache\htdocs\search\action.php
on line 3

Warning: filesize(): Stat failed for
http://a_remote_host.com/my_file.php?arg1=value1&arg2=value2 (errno=2 - No such
file or directory) in c:\apache\htdocs\search\action.php on line 4

Warning: fread(): supplied argument is not a valid stream resource in
c:\apache\htdocs\search\action.php on line 4


Can any one help me in this regard?
Saleem


		
__________________________________ 
Discover Yahoo! 
Use Yahoo! to plan a weekend, have fun online and more. Check it out! 
http://discover.yahoo.com/




PHP Data object relational mapping generator - http://www.meta-language.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux