fopen or curl post

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    fopen or curl post

    anyone can help me to submit a post variable using curl or fopen?? easy tutorial please....

    #2
    PHP Code:
    <?php
    function call_curl($goto$params '')
    {
        
    $curl curl_init(); 
        
    curl_setopt($curlCURLOPT_URL$goto); 
        
    curl_setopt($curlCURLOPT_USERAGENT$_SERVER['HTTP_USER_AGENT']);
        
    curl_setopt($curlCURLOPT_RETURNTRANSFER1); 
        if (
    $params)
        {
           
    curl_setopt($curlCURLOPT_POST1);
           
    curl_setopt($curlCURLOPT_POSTFIELDS$params);
        }
        
    $webrep curl_exec($curl); 
        
    curl_close($curl); 
        return 
    $webrep
    }

       
    $postfields = array(
           
    'username'=>'NOname',
           
    'password'=>'admin'   
       
    );
      
    # or  $postfields = 'username=admnin&password=suk';
       
    echo call_curl('http://example.com/',$postfields);
    ?>
    Last edited by i0nutzxp; 09.07.11, 16:38.
    <?php unlink('World/Europe/Romania.country'); ?>

    Comment

    Working...
    X