<script></script>
<script></script>
Venus - Open Source Social Network
if(isset($_POST["register"])){
$user_fullname = strip_tags(trim($_POST["user_fullname"]));
$user_nickname = strip_tags(trim($_POST["user_nickname"]));
$user_birthday = strip_tags(trim($_POST["user_birthday"]));
$user_location = strip_tags(trim($_POST["user_location"]));
$user_gender = strip_tags(trim($_POST["user_gender"]));
$user_location = strip_tags(trim($_POST["user_location"]));
$user_email = strip_tags(trim($_POST["user_email"]));
$user_password = md5(sha1($_POST["user_password"]));
if(!$user_nickname || !$user_password){
echo '<script>alert("Do not leave space");</script>';
}else{
$varmi = mysql_query("SELECT * FROM users WHERE user_nickname='$user_nickname'");
$say = mysql_num_rows($varmi);
if($say > 0 ){
echo '<script>alert("There is no such user name. Please use a different user name");</script>';
}else{
$register = mysql_query("INSERT INTO users values (user_id, '$user_fullname', 'img/user.png', '$user_nickname', '$user_birthday', '$user_location', '$user_gender', '', '$user_email','$user_password', 1)");
if($register){
echo '<script>alert("The registration process is successful. Please login...");</script>';
header("refresh:3;url=index.php?p=sign-in");
}else{
echo '<script>alert("There was a problem when registering...");</script>';
}
}
}
}
?>
if(isset($_POST["sign"])){
$user_nickname = strip_tags(trim($_POST["user_nickname"]));
$user_password = md5(sha1($_POST["user_password"]));
if(!$user_nickname || !$user_password){
echo '<script>alert("Boş alan bırakmayınız...");</script>';
}else{
$girisyap = mysql_query("SELECT * FROM users WHERE user_nickname='$user_nickname' AND user_password='$user_password'");
$verisay = mysql_num_rows($girisyap);
if($verisay > 0 ){
$row = mysql_fetch_array($girisyap);
$_SESSION["oturum"] = true;
$_SESSION["user_nickname"] = $row["user_nickname"];
$_SESSION["user_id"] = $row["user_id"];
echo '<script>alert("Login succeeded. Redirected to the home page in 3 seconds");</script>';
header("refresh:3;url=index.php");
}else{
echo '<script>alert("User name or password is incorrect");</script>';
}
}
}
?>
$page = $_GET['p']; //Get From Navigated Page
switch($page){
case "sign-in":
echo '
';
break;//Sign-In Page
case "register":
echo '
';
break;//Register Page
case "logout":
$uid = $_SESSION['user_id'];
mysql_query("UPDATE users SET user_active=0 WHERE 'uid'");
break;
}//Switch End
}else{//Loginned In User
switch($page){
case "".$_SESSION['user_nickname']."":
$ses1 = $_SESSION['user_nickname'];
$com1 = mysql_query("SELECT * FROM users WHERE user_nickname = '$user_nickname' LIMIT 1");
while($row2 = mysql_fetch_array($com1)){
echo '
About Me
Education
B.S. in Computer Science from the University of Tennessee at Knoxville
Location
Malibu, California
Skills
UI Design
Coding
Javascript
PHP
Node.js
Notes
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam fermentum enim neque.
';
}
break;
case "exit":
session_destroy();
header("location:index.php?p=logout");
break;
}//End Loginned In User Switch
} ?>
Ek Olarak: Profil BÖlümü en altta