Re: copy problem with HTTP wrapper

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

 



On Thu, January 26, 2006 9:28 am, Laurent Vanstaen wrote:
> Hi all,
>   I'm trying to copy a file from my PHP server to another server (a
> home
> gateway, called a LiveBox). I've used this code :
>
> $livebox = "192.168.1.1";
> ...
> ...
> ...
> $crontab_livebox = "http://".$livebox."/cgi-bin/newCrontab";;
> if (!copy($crontab_temp_name, $crontab_livebox)) {
>    echo "<br />Impossible to copy the temp crontab file to the
> Livebox.<br
> />";
> }
>
> I get the following error :
> "HTTP wrapper does not support writeable connections"
>
> OK can I solve this. Can't I use URLs with the "copy" function if they
> don't
> point to my PHP server (local URLs) ? How can I copy a file from my
> PHP
> server to another server (there's no FTP server on the destination
> machine)
> ?

Put it this way:
If what you typed above *DID* work, what's to stop *ME* from copying
whatever I want onto your server?...

You probably need to use cURL to login to your livebox, and then POST
the data into the newCrontab form handler.

The basic idea is to use cURL to "fake out" the LiveBox into thinking
that it's really you sitting there typing things.

So you would want to have your browser open and go through the process
"by hand" while you code your cURL script, and look at "View Source"
in your browser for the LiveBox login, and what the cURL script gets,
and then you POST the username/password to mimic a login, and then you
will get back some Cookies, most likely, and then you should be able
to send back those cookies and your new crontab into the form --
Essentially walking your PHP script through the exact same steps you
would take to do it by hand.

http://php.net/curl

-- 
Like Music?
http://l-i-e.com/artists.htm

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux