Skip to content

Instantly share code, notes, and snippets.

@TheYkk
Last active June 4, 2018 01:38
Show Gist options
  • Save TheYkk/043bfaa526bfad560c01512bbde39625 to your computer and use it in GitHub Desktop.
Save TheYkk/043bfaa526bfad560c01512bbde39625 to your computer and use it in GitHub Desktop.
Fonkiyonlar
<?php
function sYap($par){
if($par!=""){
foreach ($par as $p => $v){
$_SESSION[$p] = $v;
}
return true;
}else{
return false;
}
}
function sGet($par){
if($_SESSION[$par]){
return $_SESSION[$par];
}else{
return false;
}
}
function sSil($par){
if($_SESSION[$par]){
unset($_SESSION[$par]);
return true;
}else{
return false;
}
}
function go ($par, $time=0){
if($time==0){
header("Location: {$par}");
}else{
header("Refresh: {$time}; url={$par}");
}
}
function b_url($url = null)
{
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
$protocol = 'https';
else
$protocol = 'http';
if (is_null($url))
return $protocol . "://" . $_SERVER['HTTP_HOST'];
else
return $protocol . "://" . rtrim($_SERVER['HTTP_HOST'], '/') . '/' . $url;
}
function view($file,$data)
{
$layoutPath = 'lay';
/*foreach ($data as $key =>$val) {
$$key = $val;
}*/
extract($data);
include $layoutPath.'/'.str_replace(".", "/", $file).'.php';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment