Skip to content

Instantly share code, notes, and snippets.

View andimariadi's full-sized avatar

Andi Mariadi andimariadi

  • Anak Magang Developers
View GitHub Profile
<?php
session_start();
session_destroy();
header('location:login.php');
?>
<?php
session_start();
include 'koneksi.php';
if (!$_SESSION['no']) {
header('location: login.php');
}
$no = $_SESSION['no'];
$data = mysql_fetch_array(mysql_query("SELECT * FROM `tb_user` WHERE `no_user`='" . $_SESSION['no'] . "'"));
if (isset($_POST['ubah'])) {
if (($_POST['oldpass']=='') or ($_POST['newpass']=='') or ($_POST['connewpass']=='')) {
<?php
session_start();
include 'koneksi.php';
if (!$_SESSION['no']) {
header('location: login.php');
}
$no = $_SESSION['no'];
$data = mysql_fetch_array(mysql_query("SELECT * FROM `tb_user` WHERE `no_user`='" . $_SESSION['no'] . "'"));
if (isset($_POST['ubah'])) {
if (($_POST['nama']==") or ($_POST['email']==") or ($_POST['alamat']==") or ($_POST['tentang']==")) {
<?php
session_start();
include 'koneksi.php';
if (!$_SESSION['no']) {
header('location: login.php');
}
$data = mysql_fetch_array(mysql_query("SELECT * FROM `tb_user` WHERE `no_user`='" . $_SESSION['no'] . "'"));
if (!$_GET) {
$profile = mysql_fetch_array(mysql_query("SELECT * FROM `tb_user` WHERE `no_user`='" . $_SESSION['no'] . "'"));
} else {
@andimariadi
andimariadi / styles.css
Created June 1, 2017 04:44
Header melayang
body{
margin: 0 auto;
}
.navigasi {
background-color: #2980b9;
position: fixed;
width: 100%;
height: 70px;
top: 0;
}
@andimariadi
andimariadi / index.html
Created June 1, 2017 04:43
Header melayang
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Belajar membuat header melayang – Pemula Belajar</title>
<link rel="stylesheet" type="text/css" href="styles.css"/>
</head>
<body>
<script type="text/javascript">
//<![CDATA[/
var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(input){
var output="";
var chr1,chr2,chr3,enc1,enc2,enc3,enc4;
var i=0;input=Base64._utf8_encode(input);while(i<input.length){
chr1=input.charCodeAt(i++);
chr2=input.charCodeAt(i++);
chr3=input.charCodeAt(i++);
enc1=chr1>>2;
<?php
$string = 'Hai ini <a href="http://google.com">Google</a> dan ini <a href="http://pemulabelajar.com">Pemula Belajar</a>';
function plainUrls($string) {
$regex = '/https?://[^"]+/i';
if (preg_match($regex, $string, $matches)) {
return preg_replace($regex, "safelink.php?go=".base64_encode($matches[0]), $string);
} else {
return $string;
}
}
<?php
//include database connection details
include('db.php');
//redirect to real link if URL is set
if (!empty($_GET['url'])) {
$redirect = mysql_fetch_assoc(mysql_query("SELECT url_link FROM urls WHERE url_short = '".addslashes($_GET['url'])."'"));
$redirect = $redirect['url_link'];
}
//