Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

file get content php post

$postdata = http_build_query(
    array(
        'val1' => 'val1',
        'val2' => 'val2',
    )
);
$url = "your_post_url";

function post($url, $postdata){
    $opts = array('http' =>
        array(
            'method'  => 'POST',
            'header'  => 'Content-Type: application/x-www-form-urlencoded',
            'content' => $postdata
        )
    );
    
    $context  = stream_context_create($opts);
    $result = file_get_contents($url, false, $context);
    return $result;
}

print_r(post($url, $postdata));
 
PREVIOUS NEXT
Tagged: #file #content #php #post
ADD COMMENT
Topic
Name
2+9 =