Raised This Month: $ Target: $400
 0% 

[PHP] Login Help


Post New Thread Reply   
 
Thread Tools Display Modes
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 10-08-2010 , 22:42   Re: [PHP] Login Help
Reply With Quote #11

Quote:
Originally Posted by platzpatrone View Post
PHP Code:
<?php 
$User 
"Shuttle_Wave"
$Pass "test"

if(isset(
$_POST["username"]) && isset($_POST["password"]))  
{  
    if(
$_POST["username"] == $User && $_POST["password"] == $Pass)  
    {  
        
session_register("username"); 
        
session_register("password"); 
        
header("location:system.php"); 
    }  
    else  
    {  
        
$errormsg "Incorrect Username or Password";  
    }  
}  
include(
"header.php");
 
?> 
 <body>
<center> 

<h1>Admin Login Panel</h1> 

<?php if(!empty($errormsg)) echo $errormsg?>

<form action='#' method='post'> 

Username: <input type="text" name="username" id="username" /> 
Password: <input type="password" name="password" id="password" /> 
<input type="submit" name="Submit" value="Login" /></form> 

</center> 

</body> 
</html>
ty vm. works like a charm
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 10-09-2010 , 03:13   Re: [PHP] Login Help
Reply With Quote #12

The amount of fail in this is incredible.

First off, session_register hasn't been needed in since 5.3.

Quote:
This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.
So your stupid there.

Second, use session_start();. At some point you'll need to save their logged in status, and I'm assuming you'll use sessions.

And because you really don't know PHP, you should actually rely on a framework like CakePHP.
Styles is offline
Send a message via AIM to Styles
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 10-09-2010 , 04:45   Re: [PHP] Login Help
Reply With Quote #13

Quote:
Originally Posted by Styles View Post
The amount of fail in this is incredible.

First off, session_register hasn't been needed in since 5.3.



So your stupid there.

Second, use session_start();. At some point you'll need to save their logged in status, and I'm assuming you'll use sessions.

And because you really don't know PHP, you should actually rely on a framework like CakePHP.
wat would i use instead of session_register?
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
8088
Veteran Member
Join Date: Jan 2008
Old 10-09-2010 , 11:18   Re: [PHP] Login Help
Reply With Quote #14

Oh please, stop being lazy and read the manual.
Quote:
Originally Posted by Styles View Post
And because you really don't know PHP, you should actually rely on a framework like CakePHP.
Right. And because you really can't walk you should actually ride a bike.
__________________
steamID converter with OpenSearch browser plugin
8088 is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 10-11-2010 , 01:18   Re: [PHP] Login Help
Reply With Quote #15

Quote:
Originally Posted by 8088 View Post
Oh please, stop being lazy and read the manual.

Right. And because you really can't walk you should actually ride a bike.
Well, you don't really need to know PHP if you can create a database. CakePHP actually generates everything for you. Hence why I recommended Cake.
Styles is offline
Send a message via AIM to Styles
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 10-11-2010 , 01:40   Re: [PHP] Login Help
Reply With Quote #16

Quote:
Originally Posted by Styles View Post
So your stupid there.
This type of sentence lost its hilarity after my first few months of browsing forums.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 06:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode