WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Basic WWW-Authentication example
Categories : PHP, Authentication Click here to Update Your Picture
Marcus Xenakis
Date : Nov 19th 1999
Grade : 3 of 5 (graded 6 times)
Viewed : 29251
File : account.cgi
Images : No Images for this code example.
Search : More code by Marcus Xenakis
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?php
/*
==================================================================
=========
PROGRAM NAME : Authenticate.php
WRITTEN BY : Marcus S. Xenakis <marcus@xenakis.net>
VERSION : 1.00
LAST MODIFIED : 11/19/99
==================================================================
=========
COPYRIGHT NOTICE :

Copyright (c) 1999 Marcus S. Xenakis. All Rights Reserved.

This program is free software; you can change or modify it as you see fit.
However, modified versions cannot be sold or distributed.

WARRANTY DISCLAIMER:

THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT
ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
FITNESS FOR A PARTICULAR PURPOSE.
==================================================================
=========
DESCRIPTION :


The example below is not a complete program solution. It is a working example
of how to authenticate with any web page using "The Basic Authenication Relm"
from a php script It can be easily be rewritten in Perl.

It reads the enitre page into a 2K buffer string.
In the example below the web browser may have broken links to the graphics
it's trying to retrieve. This is because I echo the HTML contents to
the browser. A real application would process the $html field and extract
the data desired for procesing before display.

A note of caution, the user and password are not displayed via view source in
the displayed page. However if the script fails and the source is displayed,
passwords may be compromised. Also note that your password is stored in the
script that is stored on the site. Presumably only webmasters have access to
your site, but there have been hacks in the past.

The issue is that you should be aware of the security risks involved.
==================================================================
=========
CONFIGURATION :

Five variables must be configured for this script to
work with your site.

$site = "your_domain.com_here";
$user = "your_user_id_here";
$pass = "your_password_here";
$page = "/"; path to page / for index page
$port = 80; HTTP Note: this also has been tested via port 911, not via SSL
I suspect it will not work via SSL because of the encryption
==================================================================
=========
*/

$site = "your_domain.com_here";
$user = "your_user_id_here";
$pass = "your_password_here";
$page = "/";
$port = 80;

$user_pass = "$user:$pass";
$code = base64_encode($user_pass);

echo "<html><title>Account Info</title><body>\n";
$fp = fsockopen($site,$port,$errno,$errstr);
if (!$fp) {
echo "<h2>Error</h2>\n";
echo "$errstr ($errno) <br>\n";
} else {
fputs($fp,"GET $page HTTP/1.0\r\n");
fputs($fp,"Authorization: Basic $code\n\n");
while (!feof($fp)) {
$html = fgets($fp,2048);
echo $html;
}
fclose($fp);
}
echo "</body>\n</html>";
?>



Validation function for LUHNMod10 and variant. Can discriminate credit card numbers of varying lengths. Uses [Double >> Sum-of-Digits] transform.
Categories : Credit Cards, Authentication, Ecommerce, PHP
HTTP Basic Authentication via POP3.
Categories : Authentication, HTTP, Email, PHP
PHP4 MYSQL Authentication Script with cookie. Short & Sweet
Categories : Authentication, Apache, Cookies, PHP, MySQL
user-authentication with php3 and msql
Categories : Authentication, mSQL, PHP, Databases
complete, simple, working example of a login screen/system using php functions, cookies, and a mysql database for begginers.
Categories : Authentication, Complete Programs, PHP, MySQL, Databases
redirect redirection ip address authentication authenticate addr
Categories : Authentication, HTTP, Network, PHP
Authenticator for Exchange Server LDAP
Categories : PHP, Authentication, LDAP, Security, Sessions
Basic Authentication with sessions
Categories : PHP, Beginner Guides, Authentication, Form Processing, Sessions
phpSecurePages is a PHP module to secures pages with a loginname and password. It handles multiple user groups (each has own viewing rights), store data in a MySQL database or a configuration file, and can be used to identify Web site viewers.
Categories : PHP, Security, Authentication
Form Security - Match A Value For Success
Categories : PHP, Authentication, HTML and PHP, Sessions, Security
Use of bitmasks to represent permissions
Categories : PHP, Authentication, Bitwise Operators, Security, PHP Classes
Authorize Me! An authentication script.
Categories : MySQL, Databases, Authentication, PHP
MD5 secured login
Categories : PHP, Java Script, Authentication, Security
A simple PHP login script that you can modify to suite your needs. It use a session to store data in a session file submited by the page.
Categories : PHP, Sessions, Security, Authentication
PHP Function to Encrypt/Decrypt a string without a known key. The string itself has his own different key for every character.
Categories : PHP, Algorithms, Security, Authentication, Encryption