Skip to content

Instantly share code, notes, and snippets.

/*global browser, window, body, document, alert */
var URL = (function () {
"use strict";
var url = window.location.href;
var params = url.split("?");
var keyValues = params[1].split("&");
var objectArray = {};
@biboletin
biboletin / ajax.js
Last active February 17, 2018 13:41
var Request = {
method: "POST",
send: function(url, data, callback){
var dataToSend = this.QueryString(data);
var ajax = new XMLHttpRequest();
ajax.open(this.method, url, true);
ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
ajax.onreadystatechange = function(){
<?php
class DataBase extends MySQLi{
/**
* [$host description] адрес на сървъра
* @var string
*/
private $host = "localhost";
<?php
$link = mysql_connect("localhost", "root", "");
if(!$link) {
die("There is a problem:<br />" . mysql_error());
}
if(!mysql_select_db("DATA_BASE_NAME")) {
die(mysql_error());
}