Skip to content

Commit

Permalink
database credentials removed
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhakar267 committed Nov 2, 2016
1 parent 2d49319 commit d6d6d5b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
config.php
2 changes: 1 addition & 1 deletion delete.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
require_once "inc.database.php";
require_once "inc/inc.database.php";

if(isset($_POST["submit"])){
$id = (int)$_POST["id"];
Expand Down
5 changes: 4 additions & 1 deletion inc/inc.database.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php


// establish connection with mysql database
function connect_db(){
$connectionStatus = mysqli_connect("localhost", "root", "696163", "basic phpmyadmin");
require_once 'config.php';

$connectionStatus = mysqli_connect($MYSQL_HOSTNAME, $MYSQL_USERNAME, $MYSQL_PASSWORD, $MYSQL_DATABASE);
if(!$connectionStatus){
echo "Error connecting database";
die;
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
require_once "inc.database.php";
require_once "inc/inc.database.php";
$connectionStatus = connect_db();
?>
<!doctype html>
Expand Down
2 changes: 1 addition & 1 deletion insert.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
require_once "inc.database.php";
require_once "inc/inc.database.php";

if(isset($_POST["submit"])){
$fname = trim($_POST["fname"]);
Expand Down
2 changes: 1 addition & 1 deletion update.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
require_once "inc.database.php";
require_once "inc/inc.database.php";

if(isset($_POST["submit"])){
$id = (int)$_POST["id"];
Expand Down

0 comments on commit d6d6d5b

Please sign in to comment.