Skip to content

Instantly share code, notes, and snippets.

View cem766's full-sized avatar

cem766 cem766

View GitHub Profile
@cem766
cem766 / ajax.php
Created July 27, 2016 22:22 — forked from sametatabasch/ajax.php
CKEditor Ajax Post
<?php
$content = $_POST['editor1'];
if(empty($content)){
$response= array('status'=>'danger','msg'=>'İçerik Boş');
header('Content-Type: application/json');
echo json_encode($response);
}else{
$response= array('status'=>'success','msg'=>$content);
header('Content-Type: application/json');
@cem766
cem766 / js-ajax-php-json-return.html
Created June 27, 2016 14:10 — forked from jonsuh/js-ajax-php-json-return.html
jQuery AJAX Call to PHP Script with JSON Return
<div class="the-return">
[HTML is replaced when successful.]
</div>
@cem766
cem766 / conn.php
Created February 23, 2016 20:48 — forked from sonerufler/conn.php
PHP PDO MYSQL SİMPLE LOGİN SYSTEM
<?php // veri tabanı bağlantısı
$ip = "localhost"; //host
$user = "root"; // host id
$password = ""; // password local olduğu için varsayılan şifre boş
$db = "dbtest"; // db adı
//bağlantı
try{
$db = new PDO("mysql:host=$ip;dbname=$db",$user,$password);
// türkçe karakter için utf8
<?php
ob_start();
session_start();
$db = @new mysqli('localhost', 'root', '1234', 'uygulama');
if ($db->connect_errno) die('Bağlantı Hatası:' . $db->connect_error);
/* Tablo veri karakter yapısı */
$db->set_charset("utf8");
//üye giriş yapmış mı? ve üye admin değilse, yönlendirelim