Jump to content

Recommended Posts

  • Active+ Member

Basic homepage to register and download client.

Functions:

  • Register
  • Top 10 players
  • Download
  • Statistics

Homepage developed by me in 2 hours ?

This is the hidden content, please

This is the hidden content, please

 

spacer.pngspacer.png

 

📱 05.08.2024 - header.php updated:

<?php
	header('Cache-control: private');
	include 'config.php';
	$server_offline = 0;
	require_once("database.php");
	$database = new Connection(SERVER_IP, SERVER_ID, SERVER_PW, array(PDO::ATTR_TIMEOUT => 5, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));

	if (isset($_POST['username'], $_POST['password'], $_POST['rpassword'], $_POST['email'], $_POST['delete'])) 
	{
		$username = htmlspecialchars(trim($_POST['username']));
		$password = trim($_POST['password']);
		$rpassword = trim($_POST['rpassword']);
		$email = filter_var(trim($_POST['email']), FILTER_SANITIZE_EMAIL);
		$delete = intval($_POST['delete']); 
		
		if ($password !== $rpassword) 
		{
			$register_message = '<div class="alert alert-danger">Passwords do not match.</div>';
		} 
		elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) 
		{ 
			$register_message = '<div class="alert alert-danger">Invalid email format.</div>';
		}
		elseif (Register::Uniq($username)) 
		{
			$hash_pw			= sha1(sha1($password,true));
			$password_hash		= '*'.strtoupper($hash_pw);
			$safebox_password = "000000";
			$status = "OK";
			$safebox_size = 1;
			try 
			{
				$database->beginTransaction();
				$register_account = $database->prepare("
					INSERT INTO account (login, password, social_id, email, create_time, status) 
					VALUES (:login, :password, :social_id, :email, NOW(), :status)
				");
				$register_account->bindParam(":login", $username);
				$register_account->bindParam(":password", $password_hash);
				$register_account->bindParam(":social_id", $delete);
				$register_account->bindParam(":email", $email);
				$register_account->bindParam(":status", $status);

				if ($register_account->execute()) 
				{
					$lastID = $database->lastInsertId();
					$safebox = $database->prepare("
						INSERT INTO safebox (account_id, size, password) 
						VALUES (:account_id, :size, :password)
					");
					$safebox->bindParam(":account_id", $lastID, PDO::PARAM_INT);
					$safebox->bindParam(":size", $safebox_size, PDO::PARAM_INT);
					$safebox->bindParam(":password", $safebox_password, PDO::PARAM_STR);

					if ($safebox->execute()) 
					{
						$database->commit();
						$register_message = '<div class="alert alert-success">Successfully registered!</div>';
					} 
					else 
					{
						$database->rollBack();
						$register_message = '<div class="alert alert-danger">Failed to create safebox.</div>';
					}
				} 
				else 
				{
					$database->rollBack();
					$register_message = '<div class="alert alert-danger">Failed to register account.</div>';
				}
			} 
			catch (Exception $e) 
			{
				
				$database->rollBack();
				error_log($e->getMessage());
				$register_message = '<div class="alert alert-danger">An error occurred during registration. Please try again later.</div>';
			}
		} 
		else 
		{
			$register_message = '<div class="alert alert-danger">This username already exists!</div>';
		}
	}
?>

 

Edited by Mutulic
Core X - External 2 Internal
  • Metin2 Dev 86
  • Eyes 2
  • Good 31
  • Love 5
  • Love 54
Link to comment
https://metin2.dev/topic/31882-simple-homepage-2024/
Share on other sites

  • 2 months later...
  • Active+ Member
6 hours ago, longxiao said:

brother. How can I modify its encoding. I want to translate it into the language of other countries, but every time after translation, the website is garbled.

Can you explain?

Link to comment
https://metin2.dev/topic/31882-simple-homepage-2024/#findComment-163178
Share on other sites

On 12/10/2023 at 12:55 AM, Mutulic said:

Basic homepage to register and download client.

Functions:

  • Register
  • Top 10 players
  • Download
  • Statistics

Homepage developed by me in 2 hours ?

 

Hidden Content

  • Give reaction to this post to see the hidden content.

 

Hidden Content

  • Give reaction to this post to see the hidden content.

 

 

 

spacer.pngspacer.png

Nice

  • Metin2 Dev 2
Link to comment
https://metin2.dev/topic/31882-simple-homepage-2024/#findComment-163181
Share on other sites

  • 3 weeks later...
  • Active+ Member
On 3/1/2024 at 9:52 AM, longxiao said:

Player rankings cannot be displayed in languages other than English. The registration button is garbled

 

for custom work add me on discord

Link to comment
https://metin2.dev/topic/31882-simple-homepage-2024/#findComment-163608
Share on other sites

  • 5 months later...

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

×
×
  • 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.