Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 09-24-2008, 04:21 PM   #1 (permalink)
 
Newb Techie

Join Date: Sep 2008

Posts: 34

pcbres12 is on a distinguished road

Default Login and passwords

I am designing a website and need some code here, I want to make a login area, but i don't want everyone in the world to be able to register i want it so only people i want can register. With like a universal username and password. Can someone send me the code for it, please and thank you.
pcbres12 is offline  
Old 09-24-2008, 06:45 PM   #2 (permalink)
Baez's Avatar
 

Join Date: Sep 2005

Location: Toronto, Canada

Posts: 5,466

Baez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of light

Default Re: Login and passwords

What language?
__________________

Baez is offline  
Old 09-24-2008, 06:55 PM   #3 (permalink)
 
Newb Techie

Join Date: Sep 2008

Posts: 34

pcbres12 is on a distinguished road

Default Re: Login and passwords

English or if you want the computer language, HTML
pcbres12 is offline  
Old 09-24-2008, 07:31 PM   #4 (permalink)
Baez's Avatar
 

Join Date: Sep 2005

Location: Toronto, Canada

Posts: 5,466

Baez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of light

Default Re: Login and passwords

HTML is not a language that is capable of that. You would need to use something like JavaScript, C#, PHP, Perl etc.
__________________

Baez is offline  
Old 09-24-2008, 07:49 PM   #5 (permalink)
 
Newb Techie

Join Date: Sep 2008

Posts: 34

pcbres12 is on a distinguished road

Default Re: Login and passwords

Well, then do you know how to build something like that? Does anyone
pcbres12 is offline  
Old 09-24-2008, 08:56 PM   #6 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Login and passwords

PHP Code:
<?php

if (isset ($_POST['submit'])) {
    
$username $_POST['username'];
    
$password $_POST['password'];

    if (
$username == 'user' && $password == 'pass') {
        echo 
'logged in';
    } else {
        echo 
'Incorrect username/password!';
    }
} else {
    echo 
'<form action="index.php" method="post">
    Username: <input type="text" name="username" /><br />
    Password: <input type="password" name="password" /><br />
    <input type="submit" name="submit" value="Login" />
    </form>'
;
}

?>
Change 'user' and 'pass' to whatever you want.

Extremely simple version.
__________________

Need website help? PM me!
CrazeD is offline  
Old 09-24-2008, 09:03 PM   #7 (permalink)
 
Newb Techie

Join Date: Sep 2008

Posts: 34

pcbres12 is on a distinguished road

Default Re: Login and passwords

So i just copy and paste this into the home page of my webpage?
pcbres12 is offline  
Old 09-24-2008, 09:20 PM   #8 (permalink)
Baez's Avatar
 

Join Date: Sep 2005

Location: Toronto, Canada

Posts: 5,466

Baez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of light

Default Re: Login and passwords

Yes copy it wherever you would put the username and password textboxes. The browser scans your HTML code and recognizes that you have inserted a PHP script.
__________________

Baez is offline  
Old 09-24-2008, 10:01 PM   #9 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Login and passwords

Quote:
Originally Posted by cvb724 View Post
Yes copy it wherever you would put the username and password textboxes. The browser scans your HTML code and recognizes that you have inserted a PHP script.
Well, the browser will just display it as text. You have to have Apache or IIS installed with PHP configured to parse the PHP and output HTML.
__________________

Need website help? PM me!
CrazeD is offline  
Old 09-25-2008, 02:16 AM   #10 (permalink)
zedman3d's Avatar
 
I am of the highest lvl..

Join Date: Oct 2007

Location: Sydney, Australia

Posts: 2,454

zedman3d will become famous soon enoughzedman3d will become famous soon enough

Default Re: Login and passwords

Yeah most importantly your host needs to have PHP installed/supported.
__________________



My pick up line is: I know Vernong.

Trotter: "Ask all the questions you want... whatever we don't know, we'll make
up something that sounds pretty good."

Antec-User: "I have a display now, but the darn system is crash-bandicoot on stock"
zedman3d is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
freeze at login taintedplay Building, Buying, or Upgrading High Performance PC Systems 3 03-27-2008 02:09 AM
Login & Password fo local network eipeks Computer Networking & Internet Access 7 02-21-2008 02:05 PM
Delete login history Max Power Browser & General Internet Questions 8 12-29-2007 10:53 PM
Windows 2000 Login Problems Jack10525 Windows Operating Systems and Software 0 07-26-2007 04:09 AM
Saving passwords on PC Josef Windows Operating Systems and Software 2 05-17-2007 01:51 AM