Skip to content
Snippets Groups Projects
Commit f1195bbd authored by Sudhir's avatar Sudhir
Browse files

today sign up page is working well ==> sign up is done with unique name and...

today sign up page is working well ==> sign up is done with unique name and unique pass and unique email but ==> when sign up fails screen is blank error is not printing:sob:
parent 7f707e36
No related branches found
No related tags found
No related merge requests found
<?
$signup =false;
print_r($_POST);
if (isset($_POST['email_address']) && isset($_POST['password']) && isset($_POST['username']) && isset($_POST['phone_number'])) {
<?php
$signup = false;
$username = $_POST['username'] ;
$password = $_POST['password'] ;
$email = $_POST['email_address'];
$phone_number = $_POST['phone_number'];
$result = signup($username,$password,$email,$phone_number);
$signup =true;
print_r($_POST);
echo("HELLO");
}
echo $username ;
// Debug: Print $_POST data to check if it's being received
//print_r($_POST);
if (isset($_POST['username']) and isset($_POST['password']) and isset($_POST['email_address']) and isset($_POST['phone'])) {
$user = $_POST['username'];
$pass = $_POST['password'];
$email = $_POST['email_address'];
$phone_number = $_POST['phone'];
$error = signup($user, $pass, $email, $phone_number);
$signup = true;
echo "hello";
}
echo '<br>';
$result = validate_credentials($username , $password);
//$result = validate_credentials($username , $password);
if($signup){
if($result){
if(!$error){
?>
<div class="bg-body-tertiary p-5 rounded">
<h1>SIGN UP SUCCESSFUL</h1>
<p class="lead">you have the access to visit the photogram 😍.signup done now login</p>
<p class="lead">you have the access to visit the photogram 😍.signup done now login from <a href="/legacy_php/photogram_app/login.php">here</a>
</div>
<?
}else { ?>
<?php
} else {
?>
<div class="bg-body-tertiary p-5 rounded">
<h1>SIGN UP failed</h1>
<p class="lead">you have no access to visit the photogram</p>
<p class="lead">something went wrong ,<?=$error?> </p>
</div>
<?}
} else { ?>
<?php }
}
else {
?>
<!-- took from downloaded source code bootstrap -->
......@@ -64,8 +70,8 @@ if($signup){
</form>
<?
}
<?php
}
?>
</main>
......
......@@ -22,20 +22,21 @@
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}else{
print("CONNECTION SUCCESS \n");
}
$sql= "INSERT INTO `auth` (`username`, `password`, `email`, `phone`, `blocked`, `activate`)
VALUES ('$user', '$pass', '$email', '$phone_number', '0', '1');";
$result = false;
if ($conn->query($sql) === TRUE) {
$result=true;
$error = false;
if ($conn->query($sql) === true) {
$error=false;
} else {
$result=false;
//echo "Error: " . $sql . "<br>" . $conn->error;
$error=$conn->error;
}
$conn->close();
return $result;
return $error;
}
?>
\ No newline at end of file
......@@ -10,12 +10,19 @@ include 'libs/load.php';
// print("_FILE \n");
// print_r($_FILES);
// print("_COOKIES \n");
// print_r($_COOKIE );
// print_r($_COOKIE );S
// print("_PUT \n");
if(signup("sudhir","password","sudhir@selfmade.ninja","9999999999")){
echo("SUCCESS test");
}else{
echo("fail");
}
// if(signup("sudhir","password","sudhir@selfmade.ninja","9999999999")){
// echo("SUCCESS test");
// }else{
// echo("fail");
// }
if(signup("test1","password1","test1@example.com","9898941235")) {
echo "SUCCESSS " ;
}
else
{
echo "fail";
}
?>
</pre>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment