Skip to content

Instantly share code, notes, and snippets.

@maxx52
maxx52 / sql.php
Created March 27, 2017 13:57
query.php
<?php
$l = $_POST["l"];
$d = $_POST["d"] - 10;
$l = intval($l);
$d = intval($d);
function get_result($result_set) {
$row = mysqli_fetch_assoc($result_set);
return array_shift($row);
}
@maxx52
maxx52 / query.php
Created March 25, 2017 05:23
qiery.db
$host="localhost";
$user="root";
$pass="";
$db_name="metylan";
$link=mysql_connect($host,$user,$pass);
mysql_select_db($db_name,$link);
$check = mysql_query("SELECT * FROM `name_phone_code` WHERE code='$code'");
if (mysql_num_rows($check)) {
header('Location:./fail.html');
}else{
@maxx52
maxx52 / common.js
Created March 18, 2017 19:10
Menu:active
$(document).ready(function() {
var url=document.location.href;
$.each($(".main-mnu a"),function(e){
if(url==this.href){$(this).addClass('active');
};
});
});
function heightDetect() {
$(".main_header").css("height", $(window).height());
};
heightDetect();
$(window).resize(function() {
heightDetect();
});
@maxx52
maxx52 / gist:57810b2401c630eee701c06c29f0244e
Last active October 11, 2016 17:16
Upload data from text file in MySQL table (use when large table)
LOAD DATA INFILE 'a.txt'
INTO TABLE `table-name`
LINES TERMINATED BY '\n'
<a href="#callback" class="button fancybox">Заказать разработку!</a>
<div class="hidden">
<form id="callback" class="pop_form">
<h3>Заказать обратный звонок</h3>
<input type="text" name="name" placeholder="Ваше имя..." required />
<input type="text" name="phone" placeholder="Ваш телефон..." required />
<button class="button" type="submit">Заказать!</button>
</form>
</div>