Skip to content
Omid Bahrami
Search
  • IP Address
  • Encrypted Messenger PHP
  • PHP
  • C++
Omid Bahrami
  • IP Address
  • Encrypted Messenger PHP
  • PHP
  • C++

Sign up Page Encrypted Messenger PHP

PHP

Sign up Page

Encrypted Messenger PHP

isset

The isset() function is used to check whether a variable is set or not.
If a variable is already unset with unset() function, it will no longer be set.
The isset() function return false if testing variable contains a NULL value.

file_get_contents

The file_get_contents() reads a file into a string.
This function is the preferred way to read the contents of a file into a string. Because it will use memory mapping techniques, if this is supported by the server, to enhance performance.

json_decode

PHP’s json_decode() function takes a JSON string and converts it into a PHP variable. Typically, the JSON data will represent a JavaScript array or object literal which json_decode() will convert into a PHP array or object.

array

The array() function is used to create an array.
In PHP, there are three types of arrays:
Indexed arrays – Arrays with numeric index
Associative arrays – Arrays with named keys
Multidimensional arrays – Arrays containing one or more arrays

Create a file named index.php


<?php
function secured_error () { die("Secured By Omid Bahrami"); }
set_error_handler("secured_error");

require '../secured/secured-structure.php';
require '../secured/secured-database.php';
require '../secured/secured-encryption.php';
require '../secured/secured-validation.php';

session_start();
gns_check_https();
gns_check_cookie();
$e1=$e2=$e3=FALSE;

if(isset($_POST["signup"]))
{

if($_POST["g-recaptcha-response"]!=NULL)
{

$sk = XSECRETKEYX;
$gc = $_POST['g-recaptcha-response'];
$ip = $_SERVER['REMOTE_ADDR'];

$xxx=file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$sk.'&response='.$gc.'&remoteip='.$ip);
$xcheckx=json_decode($xxx);

if ($xcheckx->success==false)
$e1=TRUE;

else if ($xcheckx->success==true)
{

$gt=array("user"=>"user" , "pass"=>"pass" , "email"=>"email" );
if(gns_check_form($gt))
{

$xux=gns_hash_fix($_POST["user"]);
$xpx=gns_hash_pro($_POST["pass"]);
$xex=gns_encode($_POST["email"]);
$xmx=gns_encode($_POST["user"]);

if(gns_check_user($xux))
{
gns_sign_up($xux,$xpx,$xex,$xmx);
header("location:../sign-in/");
}

else
$e3=TRUE;

}

else
$e2=TRUE;

}

}

else
$e1=TRUE;

}

?>
<?php
$t="Sign up";
gns_head($t);
?>
<div class="jumbotron">
<?php

if ($e1)
echo '<p class="text-primary text-center"> Check Captcha </p>';

else if($e2)
echo '<p class="text-primary text-center"> Check Input </p>';

else if($e3)
echo '<p class="text-primary text-center"> Username Is Not Available </p>';

else
gns_welcome("Sign up");

?>
</div>
<div class="jumbotron">
<form id="form1" name="form1" method="post">
<table class="table table-condensed" style="max-width: 300px" align="center">
<tbody>
<tr>
<td>
<input type="text" name="user" id="user" class="form-control" placeholder="<?php if(!gns_show_error("user")) echo "Username"; ?>" value="<?php if(!$e3) gns_show_value("user"); ?>">
</td>
</tr>
<tr>
<td>
<input type="password" name="pass" id="pass" class="form-control" placeholder="<?php if(!gns_show_error("pass")) echo "Password"; ?>">
</td>
</tr>
<tr>
<td>
<input type="email" name="email" id="email" class="form-control" placeholder="<?php if(!gns_show_error("email")) echo "Email"; ?>" value="<?php gns_show_value("email"); ?>">
</td>
</tr>
<tr>
<td>
<div align="center">
<div class="g-recaptcha" data-sitekey="<?php echo XSITEKEYX; ?>">
</div>
</div>
</td>
</tr>
<tr>
<td>
<input type="submit" name="signup" id="signup" value="Sign up" class=" btn btn-primary ">
</td>
</tr>
</tbody>
</table>
</form>
</div>
<?php gns_foot(); ?>

Full structure is available at Encrypted Messenger PHP

Post navigation
← Previous Post
Next Post →

Copyright 2009-2023

[email protected]