none
i cant login to my website, use IIS and Ms SQL Server Studio RRS feed

  • Question

  • this is my code named process-login.php

    <?php 
    include 'config/config.php';
    if(isset($_POST['login'])){
    $nama = $_POST['nama'];
    $nomor = $_POST['nomor'];
    $dept = $_POST['dept'];
    
    $qry = sqlsrv_query($conn,"SELECT * FROM t_user WHERE nama = '".$name."' nomor = '".$nomor."' AND dept = '".$dept."'") or die( print_r( sqlsrv_errors(), true));
    if($qry){
    	session_start();
    	$_SESSION['nama'] = $nama;
    	header("Location: peserta");
    }else{
    	echo 'username/password salah';
    }
    }
    ?>

    to connect the server i'm using windows authentication . this is config.php

    <?php
    $serverName = "BHR020PC29384\PANASONIC";  
    $connectionInfo = array("Database"=>"learning");  
      
    /* Connect using Windows Authentication. */  
    $conn = sqlsrv_connect($serverName, $connectionInfo);
    ?>

    Thursday, December 19, 2019 6:13 AM