Reply
Old January 18th, 2003 Top | #1
gmagnuson
 
gmagnuson's Avatar
Unregistered
Posts: n/a

Default PHP Website

Would anyone have a php website that has a login area that I could look at the coding for. I am trying to learn php and I learn best by looking off of a template. It can be an older php website doesn't matter. Thanks!
  Reply With Quote
Old January 18th, 2003 Top | #2
 
SPeedY_B's Avatar
I may actually be insane.
Joined: March 2002
Location: Midlands, England
Posts: 15,800
Reputation: 2877
Power: 310

Arrow

You can't look at PHP code/src as you can HTML.
You'll need to download a script that someone has made, and have a look through that. try http://www.hotscripts.com/PHP/ or do a Google search.
SPeedY_B is offline   Reply With Quote
Old January 18th, 2003 Top | #3
gmagnuson
 
gmagnuson's Avatar
Unregistered
Posts: n/a

Default

Thanks that should help me!
  Reply With Quote
Old January 18th, 2003 Top | #4

OSNN Folding Team  
Zedric's Avatar
NTFS Guru
Joined: January 2002
Location: Sweden
Posts: 4,006
Reputation: 890
Power: 175

Cool

Here's the code I use (you will need a database for the user info):

This handles the login:
PHP Code:
    function Validate(){
        global 
$name;
        global 
$password;
        global 
$db;
        
$users "SELECT * FROM users WHERE nick='$name'";
        
$getval mysql($db,$users);
        if (
mysql_numrows($getval) != 0){
            if (
mysql_result($getval0'password') == $password){
                return 
true;
            }
            else return 
false;
        }
        else return 
false;
    }

    if(
Validate()){
        
session_start();
        
session_register("pass_cookie");
        
$pass_cookie $name;
        
header("Location: logged_in.php");
    }
    else{
        
// Authentication failed.
        
header("Location: login.php?badpass=yes");
    } 
This is the first page:
PHP Code:
<FORM NAME="login" METHOD="post" ACTION="login_check.php" TARGET="main">
Name: <INPUT TYPE="text" NAME="name"><BR>
Password <INPUT TYPE="PASSWORD" NAME="password"><BR>
<
INPUT TYPE="Submit" VALUE="Log in" BORDER="0">
</
FORM


Did I help you? Please use the reputation system. Click the icon on the left!
Proud host of the OSNN.net folding sigs. Want one? Check the folding thread!
http://zedric.no-ip.com/
Zedric is offline   Reply With Quote
Old January 20th, 2003 Top | #5
 
w0lv3rin3's Avatar
The Source
Joined: March 2004
Location: Barrie, ON
Posts: 465
Reputation: 0
Power: 104

Default

well if your new with php i suggest u get to know some of SQL ODBC DB

PHP is a DB language, just pulls out info from those DB.

If you Don't like my DRIVING!
Then Stay OFF the Lawns!
w0lv3rin3 is offline   Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ads On Website Bman Web Design & Coding 8 March 13th, 2008 1:24pm
Website Help. Grandmaster Web Design & Coding 11 October 8th, 2003 2:02am
my website cs-cky Green Room 5 April 7th, 2003 12:47pm
My Website! Ishwon Web Design & Coding 27 March 6th, 2003 5:19pm
Website help???????????????? mazspeed@redshi Windows Desktop Systems 10 May 10th, 2002 2:05am