[Tutorial] Creating a basic user control panel
#41

I haven't tried this tutorial, but looks nice and you're explaining what to do in a nice and simple way!
Reply
#42

This is useful, but is there a possible way to make one for .ini's ?
PLS pm if you know any UCPs for ini's.
Reply
#43

Why you don't hash your passwords?
This is one of the very basic things you always need to use when you are working with user systems like those.
Reply
#44

Thanks, all I need to learn is MYSQL and improve my performance in PHP.

Rep+.
Reply
#45

Sorry to ruin the party here, but that script is not close to quality.

1. It's not up to the standard PHP provides today and it uses unsupported functions (such as mysql_*). The use of PDO is highly recommend as it increases speed, overall performance is 101% more secure.

2. Also the way sessions are handled needs to be fixed.

3. The HTML standard you use is also not recommend anymore. xHTML transitional should not be used over HTML 5.

This is just a brief list of stuff that's wrong with this script. If I were you, I wouldn't use it.
Reply
#46

Quote:
Originally Posted by Dugzor
View Post
Sorry to ruin the party here, but that script is not close to quality.

1. It's not up to the standard PHP provides today and it uses unsupported functions (such as mysql_*). The use of PDO is highly recommend as it increases speed, overall performance is 101% more secure.

2. Also the way sessions are handled needs to be fixed.

3. The HTML standard you use is also not recommend anymore. xHTML transitional should not be used over HTML 5.

This is just a brief list of stuff that's wrong with this script. If I were you, I wouldn't use it.
Have you seen the post date? 17/10/2011. Of course it's gonna have problems with it, and I doubt the creator of the topic is going to resolve these issues: Last Activity: 24/08/2013.
Reply
#47

what about whirlpool hashing, is there a way to get it to read frmo that, so that people can login?
Reply
#48

Should not use this anymore, its outdated.
I followed this tutorial when I made my UCP:
[ame]http://www.youtube.com/watch?v=SCOPfzhGGVg[/ame]

It has 4 parts atm, some more is gonna come I think.
Reply
#49

Quote:
Originally Posted by [SWE]Alexzz
View Post
Should not use this anymore, its outdated.
I followed this tutorial when I made my UCP:
http://www.youtube.com/watch?v=SCOPfzhGGVg

It has 4 parts atm, some more is gonna come I think.
You should not use that tutorial as it uses the old MySQL functions which is no longer supported by php. If you're going to make a ucp or any php app that requires database handling use PDO (php data objects) or mysqli.
Reply
#50

Quote:
Originally Posted by DanishHaq
View Post
Have you seen the post date? 17/10/2011. Of course it's gonna have problems with it, and I doubt the creator of the topic is going to resolve these issues: Last Activity: 24/08/2013.
Maybe he will one day but not these days. I left sa:mp and I came here few times a year just to check what's new

But I will make a new tutorial on UCP after I setup sa:mp server
Reply
#51

Nice tutorial.

+REP
Reply
#52

Glad you actually contributed and gave your best on explanation, good job.
Reply
#53

Thank you! It was very helpfully, now I got a working UCP!
Reply
#54

Znas nije ovo lose Fino je uradjeno
Reply
#55

Where can i verfiy my server Ip + Port
Reply
#56

http://vestigedayz.com/ucp/login.php

Why it does not work ?


PHP Code:
<?php 
include("config.php"); //including our config.php where is connecting to mysql... 
session_start(); //starting session for profile.php (Dunno how to explain better) look little down 
error_reporting(0); //without this we will always get some stupid notice that variable isn't defined.... 
$submit $_POST['submit']; //variable for submit button, in this variable we save button that player press in <input type='submit' name="submit" value='Login' />.... 
$username sanitize($_POST['username']); //variable for username, in this variable we save text that user type in <input type="text" name="username".... 
$password sanitize($_POST['password']); //variable for password, in this variable we save text that user type in <input type="password" name="password".... 
if($submit//if he press submit button 
{     
    if(
$username && $password//if he type both of username and password not just one of them 
    

        
$query mysql_query("SELECT username, password FROM users WHERE username = '$username'"); //selecting user name and password, change it to your field names,  chage users to your table name, $username means username that he type... 
        
if(mysql_num_rows($query) == 1//if user exists 
        

            while(
$row mysql_fetch_assoc($query)) //loop thought table that we select in mysql_query 
            

                
$dbusername $row['username']; //setting dbusername as variable from table, change 'username' to your field! 
                
$dbpassword $row['password']; //setting dbpassword as variable from table, change 'password' to your field! 
            

            if(
$username == $dbusername && $password == $dbpassword//if username is same as one from table and if password is the same as one from table... 
            

                
$_SESSION['username'] = $dbusername//setting session username to one from table, this is useful if you login, that restart your browser and than you go in url where is your profile.php... Anyway this is useful :D 
                
echo header('location: profile.php'); //redirecting user to his profile page (profile.php) 
            

            else echo 
"Wrong password!"//else if user type wrong password he will get this... 
        

        else echo 
"Username doesn't exist!"//if username doesn't exist in table user will get this 
    

    else echo 
"Type name and password!"//else if user doesn't type all fields he will get this... 

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Basic UCP</title>
nuj..
<form action='login.php' method='POST'> 
<input type="text" name="username" value='<?php echo $username?>'/> 
<input type="password" name="password"/> 
<input type='submit' name="submit" value='Login' /> 
</form>
</head>
</html>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)