Monday 21, May 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    About Us    |    Contact Us

  authenticating user with browser authenticate dialog box using php

Here is a script to authenticate user with browser authenticate dailog box. Username and password is hard codded in page and will be matched with user input.
Cut & Paste Script
<?php
function authenticate_user() {
    header('WWW-Authenticate: Basic realm="Secret Stash"');
    header("HTTP/1.0 401 Unauthorized");
    exit;
}

if(! isset($_SERVER['PHP_AUTH_USER'])) {
    authenticate_user();
} else {
    $username="test";
    $password="test";
    if(!($username==$_SERVER[PHP_AUTH_USER] && $password==$_SERVER[PHP_AUTH_PW])){
        authenticate_user();
    } else {
        echo "Authentication Successfull";
    }
}
?>
 
   
     RELATED SCRIPTS
 
creating new table in MySql using php
Here is an example to create a new table in mysql database....more »
Category : PHP Examples Hits : 656
   
Uploading file using php
Here is a simple script to upload file using php. we are using move_uploaded_file function to upload file. The move_uploaded_file function needs two parameters
1. The path of the temporary file.
2. The path where it is to be moved to.
...more »
Category : PHP Examples Hits : 429
   
creating xml file using php
Here is a script to create xml file using php DOM....more »
Category : PHP Examples Hits : 555
   
Exporting data from MySql table to CSV using PHP
Here is a code example for exporting data from MySql table to a CSV File. CSV file format is a file type that stores tabular data usually processed in applications like Microsoft Excel....more »
Category : PHP Examples Hits : 1470
   
Difference Between two dates using php
This function will return the number of days elapsed between two dates....more »
Category : PHP Examples Hits : 559
   
   
SCRIPT CATEGORIES
 
  C Programs
C Programs scripts
  C++ Programs
C++ Programs scripts
  Java Programs
Java Programs scripts
  JavaScript Examples
JavaScript Examples scripts
  PHP Examples
PHP Examples scripts
  VBScript Examples
VBScript Examples scripts
 
 
 
POPULAR E-BOOKS
 
Download The Big Picture of Internet success  Ebook The Big Picture of Internet success
   
Download Affiliate Money Machine Ebook Affiliate Money Machine
   
Download Article Marketing Made Easy Ebook Article Marketing Made Easy
   
Download Excerpts from the Abstract Ebook Excerpts from the Abstract
   
Download Make Money Online Ebook Make Money Online
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz