This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$user_ip = getenv('REMOTE_ADDR'); | |
$geo = unserialize(file_get_contents("http://www.geoplugin.net/php.gp?ip=$user_ip")); | |
$country = $geo["geoplugin_countryName"]; | |
$city = $geo["geoplugin_city"]; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="text" name="address" placeholder="Address" id="autocomplete"> | |
<script src="https://maps.googleapis.com/maps/api/js?signed_in=true&libraries=places&callback=initAutocomplete" | |
async defer></script> | |
<script> | |
// This example displays an address form, using the autocomplete feature | |
// of the Google Places API to help users fill in the information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#submit').click(function(){ | |
var formData = new FormData($('#form')[0]); | |
$.ajax({ | |
url: '<?php echo base_url();?>controller/method', | |
type: 'POST', | |
data: formData, | |
async: false, | |
success: function(data) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function AddPlayTime($times) { | |
foreach ($times as $time) { | |
$all_seconds=''; | |
list($hour, $minute, $second) = explode(':', $time); | |
$all_seconds += $hour * 3600; | |
$all_seconds += $minute * 60; | |
$all_seconds += $second; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Capture Photo</title> | |
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1"/> | |
<script type="text/javascript" charset="utf-8" src="js/phonegap.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
var pictureSource; // picture source | |
var destinationType; // sets the format of returned value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$servername = "localhost"; | |
$username = "root"; | |
$password = ""; | |
$dbname = "test"; | |
// Create connection | |
$conn = mysqli_connect($servername, $username, $password, $dbname); | |
// Check connection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$('table.paginated').each(function() { | |
var currentPage = 0; | |
var numPerPage = 10; | |
var $table = $(this); | |
$table.bind('repaginate', function() { | |
$table.find('tbody tr').hide().slice(currentPage * numPerPage, (currentPage + 1) * numPerPage).show(); | |
}); | |
$table.trigger('repaginate'); | |
var numRows = $table.find('tbody tr').length; |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- phpMyAdmin SQL Dump | |
-- version 4.2.11 | |
-- http://www.phpmyadmin.net | |
-- | |
-- Host: 127.0.0.1 | |
-- Generation Time: Dec 13, 2015 at 10:50 AM | |
-- Server version: 5.6.21 | |
-- PHP Version: 5.5.19 | |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Written by Amri Shodiq. | |
* Do not hesitate to copy and paste this code. | |
* It's not embarassing. | |
*/ | |
if (!defined('BASEPATH')) | |
exit ('No direct script access allowed'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include 'include/connect.php'; | |
$tableqry = "SELECT image,maincat_name,php_name FROM tblmaincategories "; | |
$num_rows = mysql_num_rows(mysql_query("SELECT image,maincat_name,php_name FROM tblmaincategories ")); | |
$result = mysql_query($tableqry); | |
?> | |
<html> | |
<head> | |
<meta charset="utf-8"> |