git clone https://github.com/
Or, adding the username and password parameters to the previous command, instead of entering them afterwards:
git clone https://username:password@github.com/
Tips about programming, tips about software and web development in general and links to cool/useful tech sites
$filepath = '/var/www/vhosts/domain.com/http/filename.pdf'; $data = array( 'field1'=>'value1', 'field2'=>'value2', 'field3'=>"@$filepath" );/* or, instead of using the @, that is deprecated in more recent PHP versions, replace with: 'file' => new CURLFile($filepath,'application/pdf', basename($filepath)) */
$url = 'www.domain.org/post/address';try{ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); curl_close($ch); } catch (Exception $e) { $error = $e->getMessage(); return false; } ?>
use Zend\Http\Client; $data = array( 'field1'=>'value1', 'field2'=>'value2' ); $filepath = '/var/www/vhosts/domain.com/http/filename.pdf'; $url = 'www.domain.com/post/address'; $client = new Client(); $client->setUri($url); $client->setParameterPost($data); $client->setMethod('POST'); $client->setFileUpload($filepath,'field3'); $response = $client->send(); if ($response->isSuccess() === true) { $content = $response->getBody(); } ?>
document.getElementById("anchor-div").scrollIntoView();
var array_info = {}; array_info['key1'] = $("#field1").val(); array_info['key2'] = $("#field2").val(); var array_info_json = JSON.stringify(array_info); //ajax call $.ajax({ url: "file.php", type: "POST", data: { action: "parameter", field_data: array_info_json }, success: function (data) { console.log(data); if (data != '') { $('#div_container').html('Sucess'); dataArray = JSON.parse(data); } else{ alert('No data'); } }, error: function (a,b) { alert('Error'); } });