Big problem with a function file($url)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Pegamode
Forum Newbie
Posts: 2
Joined: Thu Jul 24, 2003 12:57 pm

Big problem with a function file($url)

Post by Pegamode »

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.
Pegamode
Forum Newbie
Posts: 2
Joined: Thu Jul 24, 2003 12:57 pm

Post by Pegamode »

I got it ....

the error was somewhere else ...

now it works fine.
Post Reply