Skip to content

Instantly share code, notes, and snippets.

View Octagon-simon's full-sized avatar
Turning red flags into red tests that pass.

Simon Ugorji (Octagon) Octagon-simon

Turning red flags into red tests that pass.
View GitHub Profile
@Octagon-simon
Octagon-simon / cookies-part-3.js
Created October 16, 2021 14:00
Retrieve all stored cookies in a Domain Javascript
var x = document.cookie;
console.log(x);
<?php
require_once 'PHP-Snippets/forms/form-fields-v1.3.php';
?>
@Octagon-simon
Octagon-simon / form-fields-part-2.php
Created October 16, 2021 14:28
Set up your fields Array
<?php
require_once 'PHP-Snippets/forms/form-fields-v1.3.php';
$fields = [
"fname" => "First Name",
"lname" => "Last Name",
"email" => "Email Address"
];
?>
@Octagon-simon
Octagon-simon / form-fields-part-3.php
Created October 16, 2021 14:30
Call the function by binding it to a variable then use json_decode
<?php
require_once 'PHP-Snippets/forms/form-fields-v1.3.php';
$fields = [
"fname" => "First Name",
"lname" => "Last Name",
"email" => "Email Address"
];
//call the function
@Octagon-simon
Octagon-simon / form-fields-part-4.php
Created October 16, 2021 14:31
Access Function's output by using object methods
<?php
require_once 'PHP-Snippets/forms/form-fields-v1.3.php';
$fields = [
"fname" => "First Name",
"lname" => "Last Name",
"email" => "Email Address"
];
//call the function
@Octagon-simon
Octagon-simon / form-fields-part-5.php
Created October 16, 2021 14:37
using count() to get the number of fields empty
<?php
//Let user know the number of fields empty
echo count($empty['fields']);
?>
@Octagon-simon
Octagon-simon / captcha-script-part-1.php
Created October 16, 2021 15:08
About the Verify captcha function
<?php
//Call the function
verifyCaptcha($_POST['user_answer']);
//Output 1
$return = [
'captcha_status' => 200,
'captcha_message' => 'Captcha Verified'
];
@Octagon-simon
Octagon-simon / captcha-script-part-2.php
Created October 16, 2021 15:10
import the core files
<?php
//Captcha verification script
require_once 'core/captcha_verify.php';
//Captcha custom JS
include_once 'assets/captcha_script.php';
//Captcha custom CSS
include_once 'assets/captcha_style.php';
?>
@Octagon-simon
Octagon-simon / captcha-script-part-3.html
Created October 16, 2021 15:13
create the basic html with form
<html>
<head></head>
<body>
<img id="captcha_img" src="core/captcha_image.php">
<form method="post">
<div id="captcha_form_group">
<label id="captcha_form_label">Enter Text</label>
<input id="captcha_key" name="key"> <button id="btn_captcha_refresh" type="button">&#8635;</button>
</div>
@Octagon-simon
Octagon-simon / captcha-script-part-4.php
Created October 16, 2021 15:15
Set up your post block
<?php
//Captcha verification script
require_once 'core/captcha_verify.php';
//Captcha custom JS
include_once 'assets/captcha_script.php';
//Captcha custom CSS
include_once 'assets/captcha_style.php';
if(isset($_POST)&& isset($_POST['submit'])){