ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!

Jump to content



Photo

Need a QUAD Way of making a minimal login system


  • Please log in to reply
Need a QUAD Way of making a minimal login system

#1

0x90
0x90
    Offline
    11
    Rep
    598
    Likes

    Simply, An Instruction That Does Nothing.

Posts: 332
Threads: 48
Joined: Mar 09, 2015
Credits: 0

Eight years registered
#1

like the title says, need a quick and dirty way of doing a relatively small and minimalistic PHP login system, in which basically it will run as the following pseudo-code flows:

 

default user and admin should be whatever I make it up so make it easy. No Mysql sht needed

 

if (admin_logged = true) then

{

 echo "true";

else{

echo "false";

}
}

 

the php logic should be used in a very minimalistic login html form.

 

 

Is someone available for help right now?


  • 0

jQC7VLI.gif


#2

Helios
Helios
    Offline
    105
    Rep
    113
    Likes

    Addicted

Posts: 161
Threads: 6
Joined: Jan 23, 2015
Credits: 0

Eight years registered
#2
You could easily spend some time and learn php.
This will only take you like 10 minutes to "learn".

Also do you need just 1 user to be able to login or...?
You should explain more on what you want to do.

  • 0

#3

0x90
0x90
    Offline
    11
    Rep
    598
    Likes

    Simply, An Instruction That Does Nothing.

Posts: 332
Threads: 48
Joined: Mar 09, 2015
Credits: 0

Eight years registered
#3

You could easily spend some time and learn php.
This will only take you like 10 minutes to "learn".

Also do you need just 1 user to be able to login or...?
You should explain more on what you want to do.

 

Don't have 10 minutes to learn 45+/- lines of code that it will likely be forgotten by the next few months, I just need it for now, wasn't interested in learning it actually.

 

Yes, it's only 1 user and that's it...


  • 0

jQC7VLI.gif


#4

Helios
Helios
    Offline
    105
    Rep
    113
    Likes

    Addicted

Posts: 161
Threads: 6
Joined: Jan 23, 2015
Credits: 0

Eight years registered
#4
Something like this?


<?php
session_start();

if(isset($_POST['password']) && isset($_POST['username']))
if($_POST['username'] == 'YOUR_USERNAME' && $_POST['password'] == 'YOUR_PASS')
$_SESSION['loggedin'] = true;

if(!isset($_SESSION['loggedin'])){
echo '<form action="" method="POST">
Please login to view this page <br>
Username: <input type="text" name="username"><br>
Password: <input type="password" name="password"><br>
<input type="submit" value="Submit">
</form>';
exit;
}
?>

You are logged in.

  • 1

#5

0x90
0x90
    Offline
    11
    Rep
    598
    Likes

    Simply, An Instruction That Does Nothing.

Posts: 332
Threads: 48
Joined: Mar 09, 2015
Credits: 0

Eight years registered
#5

Somthing like this?


<?php
session_start();

if(isset($_POST['password']) && isset($_POST['username']))
if($_POST['username'] == 'YOUR_USERNAME' && $_POST['password'] == 'YOUR_PASS')
$_SESSION['loggedin'] = true;

if(!isset($_SESSION['loggedin'])){
echo '<form action="" method="POST">
Please login to view this page <br>
Username: <input type="text" name="username"><br>
Password: <input type="password" name="password"><br>
<input type="submit" value="Submit">
</form>';
exit;
}
?>

You are logged in.

Yes! perfect, thank you, also whenever I try to relogin using GET method with different values and passing the parameters like an API which is my aim, cuz this will be used by an external program, it just redirects me to the webhost website... any thoughts?

 

*Edit*

 

nvm your code works perfectly, i was just being retard xD

 

was doing

http://example.net/login.php&username=123123&password=123123

 

instead of:

http://example.net/login.php?username=123123&password=123123


  • 0

jQC7VLI.gif



 Users browsing this thread: