Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
<?php
//This page let users sign up
include('config.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<title>Sign Up</title>
</head>
<body>
<div align="center">
<div class="header" style="margin: auto;width: 100%;margin-top: 10px">
<a href="<?php echo $url_home; ?>"><img width="80%" src="<?php echo $design; ?>/images/logo.png" alt="Espace Membre" /></a>
</div>
</div>
<?php
if(isset($_POST['username'], $_POST['password'], $_POST['passverif'], $_POST['email'], $_POST['user_address'], $_POST['contact']) and $_POST['username']!='')
{
if(get_magic_quotes_gpc())
{
$_POST['username'] = stripslashes($_POST['username']);
$_POST['password'] = stripslashes($_POST['password']);
$_POST['passverif'] = stripslashes($_POST['passverif']);
$_POST['email'] = stripslashes($_POST['email']);
$_POST['user_address'] = stripslashes($_POST['user_address']);
$_POST['conact'] = stripslashes($_POST['contact']);
}
if($_POST['password']==$_POST['passverif'])
{
if(strlen($_POST['password'])>=6)
{
if(preg_match('#^(([a-z0-9!\#$%&\\\'*+/=?^_`{|}~-]+\.?)*[a-z0-9!\#$%&\\\'*+/=?^_`{|}~-]+)@(([a-z0-9-_]+\.?)*[a-z0-9-_]+)\.[a-z]{2,}$#i',$_POST['email']))
{
// edited by salman
$username = mysqli_real_escape_string($var,$_POST['username']);
$password = mysqli_real_escape_string($var,sha1($_POST['password']));
$email = mysqli_real_escape_string($var,$_POST['email']);
$user_address = mysqli_real_escape_string($var,$_POST['user_address']);
$contact = mysqli_real_escape_string($var,$_POST['contact']);
$dn = mysqli_num_rows(mysqli_query($var,'select r_id from request where username="'.$username.'"'));
if($dn==0)
{
$dn2 = mysqli_num_rows(mysqli_query($var,'select r_id from request'));
$id = $dn2+1;
if(mysqli_query($var,'insert into request(r_id, username, password, email, user_address,contact, signup_date) values ('.$id.', "'.$username.'", "'.$password.'", "'.$email.'", "'.$user_address.'", "'.$contact.'", "'.time().'")'))
{
$form = false;
?>
<div class="message">Your SignUp request has been sent successfully. You will get an email once your request has been approved<br />
<a href="login.php">Log in</a></div>
<?php
}
else
{
$form = true;
$message = 'An error occurred while signing you up.';
}
}
else
{
$form = true;
$message = 'Another user already use this username.';
}
}
else
{
$form = true;
$message = 'The email you typed is not valid.';
}
}
else
{
$form = true;
$message = 'Your password must have a minimum of 6 characters.';
}
}
else
{
$form = true;
$message = 'The passwords you entered are not identical.';
}
}
else
{
$form = true;
}
if($form)
{
if(isset($message))
{
echo '<div class="message">'.$message.'</div>';
}
?>
<!-- <div class="contentsignup"> -->
<div class="contentusers">
<div class="box">
<div class="box_left">
<a href="login.php">WCSF Index</a> &gt; Sign Up Request Form
</div>
<div class="box_right">
<a href="login.php">Login</a>
</div>
<div class="clean"></div>
</div>
<form action="signup_request.php" method="post">
Please fill this form to Create a Signup Request:<br /><br />
<div class="center">
<label for="username">Username</label><input type="text" name="username" value="<?php if(isset($_POST['username'])){echo htmlentities($_POST['username'], ENT_QUOTES, 'UTF-8');} ?>" required/><br />
<label for="password">Password<span class="small">(6 characters min.)</span></label><input type="password" name="password" /><br />
<label for="passverif">Password<span class="small">(verification)</span></label><input type="password" name="passverif" / required><br />
<label for="email">Email</label><input type="text" name="email" value="<?php if(isset($_POST['email'])){echo htmlentities($_POST['email'], ENT_QUOTES, 'UTF-8');} ?>" required/><br />
<label for="contact">Contact Number</label><input style="width: 150px" type="text" name="contact" value="<?php if(isset($_POST['contact'])){echo htmlentities($_POST['contact'], ENT_QUOTES, 'UTF-8');} ?>" required/><br />
<label for="user_address">User address<span class="small"></span></label><input type="text" name="user_address" value="<?php if(isset($_POST['user_address'])){echo htmlentities($_POST['user_address'], ENT_QUOTES, 'UTF-8');} ?>" required/><br /><br />
<input type="submit" value="Sign Up Request"/>
</div>
</form>
</div>
<?php
}
?>
<!-- <div class="foot">
<p><b>Water Control System and Discussion Portal for Farmers</b></p>
</div> -->
</body>
</html>