Skip to content

Instantly share code, notes, and snippets.

@emmykolic
Created December 22, 2022 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emmykolic/c0850eb855c6203e297aabe93c7ebbd3 to your computer and use it in GitHub Desktop.
Save emmykolic/c0850eb855c6203e297aabe93c7ebbd3 to your computer and use it in GitHub Desktop.
The page that the database connection is done
<?php
session_start();
$db=new mysqli("localhost", "root", "", "gd_test");
Define("SITE_NAME", "Rights.com");
Define("SITE_SLUG", "Taking action on abuse");
function get_post($index){
$index=$_POST[$index];
return $index;
}
function set_alert($msg, $alert_type="danger"){
$_SESSION['msg']=$msg;
$_SESSION['alert_type']=$alert_type;
}
function get_alert(){
if(isset($_SESSION['msg']) && $_SESSION['msg']!=""){
?>
<div class="alert alert-<?=$_SESSION['alert_type']?>"><?=$_SESSION['msg']?></div>
<?php
}
$_SESSION['msg']="";
$_SESSION['alert_type']="";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment