| | |
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 |
ajax ajaxexample apple array attack bbc beginner body broadcast business c# class cms code contentsharing copyright curl database development display donhenley dropdownlist email error execution facebook fairuse files flash form forms gaudi gentoo google html image include insert internet itunes java javascript jcpenney jquery kids lamp limit link linux login mail malfunction marketing menu mobile multiple music mysql navigation news online oop pakistan password php politics post privacy query riaa script search security select session sms soap socialmedia socialnetworking software spam sql stats thread traffic tutorial tv twitter ubuntu uk upload validation viacom video viralmarketing web web2.0 windows youtube zend







