Skip to content

Instantly share code, notes, and snippets.

View Dreamka's full-sized avatar

Алексей Dreamka

  • Челябинск
View GitHub Profile
@Dreamka
Dreamka / ajax.js
Created December 30, 2014 19:58
ajax.js
$.ajax({
type: "GET",
url: "/ajax.php",
data: "token=" + token + "&" +
"u_login=" + login + "&" +
"u_password=" + password,
success: function(req){
console.log(req);
}
});
@Dreamka
Dreamka / ajax.php
Created December 30, 2014 19:56
ajax.php
<?php
include_once ("http_request.php");
$data = $_GET;
print_r( http_request(array(
'url'=>"https://pddimp.yandex.ru/reg_user_token.xml?".
"token=" . $data['token'] . "&" .
"u_login=" . $data['u_login'] . "&" .
"u_password=" . $data['u_password']
@Dreamka
Dreamka / http_request.php
Created December 30, 2014 19:54
http_request.php
<?php
/**
* HTTP Request v1.0 by Denik
* Parametres:
* - (string) or (array)[url] - site url
* - [method] - POST | GET
* - [data] - array of post data
* - [port] - connection port
* - [timeout] - timeout connection
* - [redirect] - true, allow redirects in headers