Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CONFIG.PHP
- <?php
- $host = 'localhost';
- $user = 'root';
- $pass = '';
- $dbname = 'penjualan_ikan';
- $connect = mysql_connect($host, $user, $pass) or die(mysql_error());
- $dbselect = mysql_select_db($dbname); 'pemesanan';
- ?>
- ADMIN.PHP
- <?php include('koneksi.php') ?>
- <h1>Admin</h1>
- <form action="" method="POST">
- Username:<input type="text" name="admin" size="20" maxlenght="9" class="form-control">
- Password:<input type="password" name="password" size="20" class="form-control">
- <br><input type="submit" name="submit" class="btn btn-primary">
- <input type="reset" name="cancel" class="btn btn-primary">
- </form>
- </div><!-- container -->
- </body>
- </html>
- <?php if (isset($_POST['submit']))
- {
- if (!empty($_POST['admin']) && !empty($_POST['password'])) {
- if ($_POST['admin']=="admin" && $_POST['password']=="123"){
- header('location:viewadmin.php');
- }
- } else {
- echo 'login gagal';
- }
- }
- KONEKSI.PHP
- <?php
- $host = "localhost";
- $user = "root";
- $pass = "";
- $db = "penjualan_ikan";
- $koneksi = mysqli_connect($host, $user, $pass, $db);
- if(mysqli_connect_errno()){
- echo "Gagal Terhubung ".mysqli_connect_error();
- }
- ?>
- <?php include('config.php') ?>
- <!DOCTYPE html>
- <html>
- VIEWADMIN.PHP
- <body>
- <?php
- include('tips.php');
- ?>
- <?php
- include('tabeldaya.php');
- ?>
- </body>
- </html>
- DELETE.PHP
- <?php
- include('config.php');
- $id = $_GET['id'];
- $query = mysql_query("delete from penjualan_ikan where pemesanan=$id") or die(mysql_error());
- if ($query) {
- header('location:viewadmin.php');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement