<link rel="stylesheet" href="design.css">
<?php
session_start();
mysql_connect("localhost", "root", "123456") or die ("No connection to the curry server.");
mysql_select_db("PTP") or die ("Go eat curry");
if(!isset($_SESSION['id']))
{
echo "<div class='loginbox'><form method='POST'><input type='text' name='username' placeholder='Username' required><br><input type='password' name='password' placeholder='Password' required><br><br><button type='submit' name='login'>Login</button> <button type='submit' name='register'>Register</button></form></div>";
if(isset($_POST['login']))
{
if($_POST['username'] == "" || $_POST['password'] == "")
{
echo "<script type='text/javascript'>alert('You dont have entered you data my friend.');</script>";
}
else
{
$name = "SELECT * FROM account where Name='". $_POST['username'] ."' and Password='". $_POST['password'] ."' LIMIT 1";
$ergebnis = mysql_query($name);
while($row = mysql_fetch_object($ergebnis))
{
$id = $row->id;
$_SESSION['id'] = $id;
echo "<meta http-equiv='refresh' content='0; URL='>";
}
if(!isset($_SESSION['id'])) echo "<script type='text/javascript'>alert('The username or the password is false.');</script>";
}
}
if(isset($_POST['register']))
{
if($_POST['username'] == "" || $_POST['password'] == "")
{
echo "<script type='text/javascript'>alert('You dont have entered you data my friend.');</script>";
}
else
{
$name = "SELECT count(id) as count FROM account where Name='". $_POST['username'] ."'";
$ergebnis = mysql_query($name);
while($row = mysql_fetch_object($ergebnis))
{
$count = $row->count;
}
if($count) echo "<script type='text/javascript'>alert('This username already exists.');</script>";
else {
$name = "insert into account (Name, Password) VALUES ('". $_POST['username'] ."', '". $_POST['password'] ."')";
mysql_query($name);
echo "<meta http-equiv='refresh' content='0; URL='>";
echo "<script type='text/javascript'>alert('Your account was successiful registered. You can log in now.');</script>";
}
}
}
exit;
}
else
{
$name = "SELECT * FROM account where id='". $_SESSION['id'] ."' LIMIT 1";
$ergebnis = mysql_query($name);
while($row = mysql_fetch_object($ergebnis))
{
$userID = $row->id;
$userBalance = $row->Balance;
$userViews = $row->Views;
}
echo "<div class='navbar'><ul><li><a href='index.php'>Dashboard</a></li><li><a href='payment.php'>Payments</a></li><li><a href='support.php'>Support</a></li><li><a href='contest.php'>Contest</a></li><li><a href='logout.php'>Logout</a></li></ul></div>";
}
?>
Alles anzeigen
Script ist PHP 5.6 ( Die Indischen "Witze" kommen von meinem Coder )
das Script läuft derzeit auf
http://194.135.83.1/
/edit
der jenige der mir Hilft das Problem zu beheben bekommt eine Entschädigung per Paypal!