| | |
login at youtube using cURL and php ?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Hello. I'm quite a newbie to cURL and php. I have been trying hard to login at youtube using cURL but haven't had any success.
All i get in return when i run the following code is the youtube login page, with my username(which i used in the code) written at the username Field and it doesn't login.
Can anyone tell me what's goin on ?
All i get in return when i run the following code is the youtube login page, with my username(which i used in the code) written at the username Field and it doesn't login.
Can anyone tell me what's goin on ?

php Syntax (Toggle Plain Text)
<?php $posturl = '&GALX=obiRBhLUBIa&Email=myfancyusername@gmail.com&Passwd=myfancypassword&rmShown=1&signIn=Sign+in&asts='; $ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookieYoutube"); curl_setopt($ch, CURLOPT_URL,"https://www.google.com/accounts/ServiceLogin?service=youtube"); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded")); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookieYoutube"); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false ); curl_setopt($ch, CURLOPT_REFERER,"https://www.google.com/accounts/ServiceLogin?service=youtube"); curl_setopt($ch, CURLOPT_POSTFIELDS, $posturl); $output = curl_exec ($ch); curl_close($ch); echo $output; ?>
You should be able to if you send the right HTTP request. Since the login page is under HTTPS, observing the HTTP request is not straight forward.
What are you using to look at the HTTP request, if any? Or are you just creating the request based on the login form?
What are you using to look at the HTTP request, if any? Or are you just creating the request based on the login form?
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
Other Threads in the PHP Forum
- Previous Thread: not a valid MySQL result resource
- Next Thread: Problem with Serial Number in PHP
| Thread Tools | Search this Thread |
access advertising air ajax apple array asp bbc beginner bestbuy broadcast business c# class cms contentsharing copyright curl data database development display email errorlog facebook fairuse files flash form forms forum function google government html image include integration internet itunes java javascript jquery lamp limit link linux login mail marketing menu mobile multiple music mysql news online oop paging password paypal pdf php politics popup post privacy problem query religion riaa script search security session sms soap socialmedia socialnetworking spam sql sql2008 stats tutorial tv twitter ubuntu uk upload validation vbulletin viacom video viralmarketing web web2.0 webdesign xml youtube zend







