d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > [simple Login] Website Needs A Login System. > Where Can I Find A System.
Add Reply New Topic New Poll
Member
Posts: 9,069
Joined: Jun 6 2009
Gold: 0.00
May 7 2013 03:48am
hello.
Basically I have a website with multiple pages .
home/music/videos/pictures/worlds/games/chat/comments/help/rules

Now ... i am at like the very end of my website....
I am using DisQus as a comment system...... basically all they make u do is
<script> their website -- blah blah blah </script>
to delete anyone's comments on my page, i have to do it manually from their website... and takes for ever to load.
also I figured this won't be compatible/existing for ever. so i thought its time to make my own Comments box.
the only issue is that, I don't have a type of login system on my website.
also another thing i am working on is a chat box/system

-------------------------------
for comments / chat I wouldn't mind letting people type a random name in a box....
the only issue is that, i wan't to be able to control it /edit it/delete spam.
so that is why I need to find some kind of login system.... hopefully a simple one.
-----
I am not really looking for a high protected one either.
-- also wouldn't mind being able to send people messages.. but i figured ill do that part in a few years...
so anywyas, if anyone has any ideas... and could point me in the right direction that would be great..
b/c i just tryed to type in google for a html login system... and i am basically getting a bunch of useless stuff that doesn't work..
or like FTP logins and other stuff thats not even related to what i need , so please help :)

This post was edited by conetopia on May 7 2013 03:49am
Member
Posts: 20,413
Joined: Dec 16 2006
Gold: 27,171.00
May 7 2013 01:34pm
dont exactly understand what you wanna do,

but there are several content mangement systems which come with a native login system, like wordpress, joomla, typo3.

to avoid spam from bots/anonymous users you can use recaptcha: http://www.google.com/recaptcha



Member
Posts: 22,263
Joined: Mar 15 2011
Gold: Locked
Trader: Scammer
Warn: 40%
May 7 2013 01:43pm
phpbb
wordpress
mybb
minibb
etc..

if u need help i can try

Member
Posts: 11,610
Joined: Oct 28 2008
Gold: 1,795.00
May 7 2013 11:25pm
Wrote this bit of code back when I was 14, just copy and pasted so

Code

<!--
This will show the login form,
Put this where you want the login form to be
-->

<form action="process_login.php" method="post">  <!--Take note of where the URL action="" points to-->
Username: <input type="text" name="username" /><br />
Password: <input type="password" name="password" /><br />
<input type="submit" value="Login" />

<!--
The following code will be on the page where the action="" page points
In this case, all this code should be on the page process_login.php
-->

<?php
mysql_connect ('databaseaddress ie localhost', 'username', 'password');
mysql_select_db ('database');

$username = mysql_real_escape_string($_POST['username']);
$password = mysql_real_escape_string($_POST['password']);

$result = mysql_query("SELECT * FROM thetablename WHERE username = '$username' AND password = '$password'  "); // YOU WILL NEED TO SWITCH OUT "thetablename" with the name of your table!

if(mysql_num_rows($result))
{
 // Login
 session_start();
 $_SESSION['username'] = htmlspecialchars($username); // htmlspecialchars() sanitises XSS
}
else
{
 // Invalid username/password
 echo '<p><strong>Error:</strong> Invalid username or password. <a href="login.php">Go back.</a></p>';  
 //Either use the above code to display it on the same page,
 //or you can use the code: header('Location: wrongpassword.php'); to redirect to a page
 //If you choose to redirect, replace the echo ''; message with the header(''); code
}

// Redirect
header('Location: announce.php');
//This happens after it processes the page, this is the page you will be re-directed to. If the login fails, it will re-direct you to this page unless
//you re-direct prior to this, (I would have it happen under the Invalid username/password comment
exit;

?>

<!--
There you have it, this code will start a session (login/cookie) with a database who isn't encrypted with the rows Username, and Password
-->
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll