FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Posting Data with php 4 and downloading a file.





Dougie1
Because this site is only php 4 I can't use the new functions.

I have been trying this to log into youtube and output what is on the next page but it doesn't seem to work:

Code:
<?php
$server= 'www.youtube.com';
$url = '/login?next_url=/watch%3Fv%3DXcHyY9poq4w';
$content = 'username=YOUTUBE&password=YOUTUBE';
$content_length = strlen($content);
$headers= "post $url HTTP/1.0\r\nContent-type: text/html\r\nHost: $server\r\nContent-length:

$content_length\r\n\r\n";
$fp = fsockopen($server, 80, $errno, $errstr);
if (!$fp) return false;
fputs($fp, $headers);
fputs($fp, $content);
$ret = "";
while (!feof($fp)) {
$ret.= fgets($fp, 1024);
}
fclose($fp);
print $ret;

?>


Any help would be appreciated.








My second question is that when I download a file using header information I include:

header("Content-Length: " .$filesize);

But still firefox sais downloading .... of unknown size. How do I sort this?

Thanks.
jabapyth
is there any reson to log in?
you can view videos without it
Dougie1
jabapyth wrote:
is there any reson to log in?
you can view videos without it

Yes there is. I have tried every way around it. You cannot view videos if they are marked as inappropriate.

Does anyone know about the downloading or the posting? Thanks.
Related topics
users online, using php and text file
php image exif functions
Indigoperl includes a copy of Apache 2.0.44, PHP 4.2.3, perl
PHP VS ASP
Using pgSQL and MS SQL with php 4/5
PHP script installation for $4 or FRIH$ 30 (Worth $1000)
File move + from NTFS to FAT32 = Data loss ??
Need Expert help in php-mysql
PHP Read File Help needed.
php 4
PHP and cookies. Simple problem.
Frihost heeft PHP 4.1 en MySQL 4.0 of hoger?
PHP Snippet
Relatively Secure Session Management System for PHP
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.