Jump to content

Register & Login Script


Recommended Posts

Dear Metin2Dev Community,

I'm kind of new to web developing, and I'm in need of help. I'm trying to use a registration & login script to my website. But I've no idea where to put the php files, I've tried to use FileZilla, but it is just giving me errors.
Can anybody here help me, telling me where to put 'em or linking any tutorial. All kind of help is very much appreciated.

Kind Regards,

Texas

Link to comment
Share on other sites

  • 1 month later...

Config - server information

<?php
$dbhost = "serverip";
$dbuser = "root";
$dbpass = "mysqlpass";
$mysql_db = "account";
?>

Register page (only php)

<?php
include('config.php'); // server config
 
if(isset($_POST['submit']) && $_POST['submit'] == 'Register') {
$username = mysql_real_escape_string($_POST['username']);
$passwd = mysql_real_escape_string($_POST['passwd']);
$passwd2 = mysql_real_escape_string($_POST['passwd2']);
$email = mysql_real_escape_string($_POST['email']);
$social_id = mysql_real_escape_string($_POST['social_id']);
 
if($passwd == $passwd2) {
$sql = "INSERT INTO account SET login = '".$username."' password = PASSWORD('".$passwd."') email = '".$email."' social_id = '".$social_id."'";
$result = mysql_query($sql);
 
if($result) { echo "Register ok"; } else { echo "Register declined"; }
}
}
 
?>

  • Eyes 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.