Activity Stream
48,167 MEMBERS
62800 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1.     
    #1
    Member

    Default PHP cURL help needed

    I need the HTTP header of this link
    Code: 
    http://www.dailymotion.com/cdn/H264-320x240/video/xucehg.mp4?auth=1350479679.4161f93bd3590e4816bddb233bd025df
    Here is the code i used..
    PHP Code: 
    function curlheaders($link)
    {
        
    $ch curl_init($link);
        
    curl_setopt($chCURLOPT_HEADER1);
        
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
        
    curl_setopt($chCURLOPT_NOBODY1);
        
    curl_setopt($chCURLOPT_SSL_VERIFYPEER0);
        
    curl_setopt($chCURLOPT_USERAGENT'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4');
        
    $headers = array(
            
    'Connection: keep-alive'
            
    'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
            
    'Accept-Encoding: gzip,deflate,sdch',
            
    'Accept-Language: en-US,en;q=0.8',
            
    'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3'
        
    );
        
    curl_setopt($chCURLOPT_HTTPHEADER$headers);
        
    curl_setopt($chCURLOPT_CUSTOMREQUEST'GET');
        
    $page curl_exec($ch);
        return(
    $page);
        
    curl_close($ch);
    }

    echo 
    curlheaders('http://www.dailymotion.com/cdn/H264-320x240/video/xucehg.mp4?auth=1350479679.4161f93bd3590e4816bddb233bd025df'); 
    When i run the above code it give me a 403 forbidden response from dailmotion.. Any Idea ?
    warezrock Reviewed by warezrock on . PHP cURL help needed I need the HTTP header of this link http://www.dailymotion.com/cdn/H264-320x240/video/xucehg.mp4?auth=1350479679.4161f93bd3590e4816bddb233bd025df Here is the code i used.. function curlheaders($link) { $ch = curl_init($link); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_NOBODY, 1); Rating: 5
    Can Do :-
    PSD TO ANY CMS | PHP(Dynamic Site) | MySql | Script Customization | cUrl Related Work
    Pm me for more info ;)

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    imdber.org justpaste.me
    Why do some `curl_setopt()` use a different handler? $ch, $curl, $your_resource

  4.     
    #3
    Member
    Quote Originally Posted by Apathetic View Post
    Why do some `curl_setopt()` use a different handler? $ch, $curl, $your_resource
    different handler like ? Can you give me a small example ?
    Can Do :-
    PSD TO ANY CMS | PHP(Dynamic Site) | MySql | Script Customization | cUrl Related Work
    Pm me for more info ;)

  5.     
    #4
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    ^
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($your_resource, CURLOPT_HTTPHEADER, $headers);

    These variables are not defined, it should be $ch

    As for forbidden, the response headers are same when viewed through browser. Check the url / you probably need to send some cookies / login before

  6.     
    #5
    Member
    ^
    Sorry, code updated.Still doesn't work.

    Ok, looking the site for cookies but i think its not needed to access that page because it return a 302 redirect .
    Can Do :-
    PSD TO ANY CMS | PHP(Dynamic Site) | MySql | Script Customization | cUrl Related Work
    Pm me for more info ;)

  7.     
    #6
    Member
    Website's:
    sborg.us
    Check the link properly, it has "auth=1350479679.4161f93bd3590e4816bddb233bd02 5df"

    That means the link also checks for your session. In this case, it just shows me a blank page if I try to visit that link via Firefox.

    V3g3ta | Halcyon | Abhi

  8.     
    #7
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in

    Forbidden here

    By chrome, same:

  9.     
    #8
    Member
    Quote Originally Posted by Halcyon View Post
    Check the link properly, it has "auth=1350479679.4161f93bd3590e4816bddb233bd02 5df"

    That means the link also checks for your session. In this case, it just shows me a blank page if I try to visit that link via Firefox.
    Yeah, But it's loading fine in chrome

    ---------- Post added at 09:15 PM ---------- Previous post was at 09:12 PM ----------

    Quote Originally Posted by soft2050 View Post

    Forbidden here
    ops it seem that it need some divix code to load in browser

    ---------- Post added at 09:32 PM ---------- Previous post was at 09:15 PM ----------

    Quote Originally Posted by soft2050 View Post

    Forbidden here

    By chrome, same:
    In chrome i am getting this

    Can Do :-
    PSD TO ANY CMS | PHP(Dynamic Site) | MySql | Script Customization | cUrl Related Work
    Pm me for more info ;)

  10.     
    #9
    Member
    Website's:
    sborg.us
    Coz you've not closed the browser + cleared your cookies.

    Also, in the response there's a link re-director "Location" which gives you the new link that you need to curl to.

    V3g3ta | Halcyon | Abhi

  11.     
    #10
    Member
    Quote Originally Posted by Halcyon View Post
    Coz you've not closed the browser + cleared your cookies.

    Also, in the response there's a link re-director "Location" which gives you the new link that you need to curl to.
    Maybe.

    Yes i need that link that is in "Location"

    ---------- Post added at 10:47 PM ---------- Previous post was at 09:45 PM ----------

    Problem solved, it was a cookie issue.
    Thanks Halcyon


    mod please closed this topic.
    Can Do :-
    PSD TO ANY CMS | PHP(Dynamic Site) | MySql | Script Customization | cUrl Related Work
    Pm me for more info ;)

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Need Help In cURL Progressbar
    By saninokia in forum Web Development Area
    Replies: 20
    Last Post: 20th Jan 2012, 08:14 AM
  2. Curl url file (I need help)
    By spanero in forum Web Development Area
    Replies: 3
    Last Post: 22nd Dec 2011, 04:23 PM
  3. [PHP] Log into WUpload using CURL
    By _Vick in forum Web Development Area
    Replies: 0
    Last Post: 25th Nov 2011, 06:58 AM
  4. Curl IPB help
    By xwarlordx in forum Web Development Area
    Replies: 3
    Last Post: 23rd Aug 2011, 06:33 AM
  5. Php cUrl Help Needed
    By warezrock in forum Web Development Area
    Replies: 3
    Last Post: 4th Aug 2011, 11:51 PM

Tags for this Thread

BE SOCIAL