Big problem with a function file($url)
Posted: Thu Jul 24, 2003 12:57 pm
Hi there,
I use the following function to call a website and read out the html response :
function GetUrl($url)
{
$lines = file($url);
for($i=0;$i<sizeof($lines);$i++)
{
$all_lines .= $lines[$i];
}
return $all_lines;
}
That works fine, but I have the problem that the site a want to call needs some parameters.
So I added them to the url, e.g. http://www.bla.com?test=1&name=2 ...
That still works fine.
Now the problem :
I have to submit the content of a textarea to that site.When I take the content, use the urlencode() function and then call my getUrl() function I get an error that the url is too long.
So how do I submit that 'long' data to the next site without getting the html code of the called site to my browser ???
Thanks in advance.
I use the following function to call a website and read out the html response :
function GetUrl($url)
{
$lines = file($url);
for($i=0;$i<sizeof($lines);$i++)
{
$all_lines .= $lines[$i];
}
return $all_lines;
}
That works fine, but I have the problem that the site a want to call needs some parameters.
So I added them to the url, e.g. http://www.bla.com?test=1&name=2 ...
That still works fine.
Now the problem :
I have to submit the content of a textarea to that site.When I take the content, use the urlencode() function and then call my getUrl() function I get an error that the url is too long.
So how do I submit that 'long' data to the next site without getting the html code of the called site to my browser ???
Thanks in advance.