コード例 #1
0
ファイル: index.php プロジェクト: intfrr/sqli-labs

<?php 
//including the Mysql connect parameters.
include '../sql-connections/sql-connect-1.php';
include '../sql-connections/functions.php';
error_reporting(0);
$pag = $_SERVER['PHP_SELF'];
//generating page address to piggy back after redirects...
$characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
//characterset for generating random data
$times = 130;
$table = table_name();
$col = column_name(1);
// session id column name
$col1 = column_name(2);
//secret key column name
// Submitting the final answer
if (!isset($_POST['answer_key'])) {
    // resetting the challenge and repopulating the table .
    if (isset($_POST['reset'])) {
        setcookie('challenge', ' ', time() - 3600000);
        echo "<font size=4>You have reset the Challenge</font><br>\n";
        echo "Redirecting you to main challenge page..........\n";
        header("refresh:4;url=../sql-connections/setup-db-challenge.php?id={$pag}");
        //echo "cookie expired";
    } else {
        // Checking the cookie on the page and populate the table with random value.
        if (isset($_COOKIE['challenge'])) {
            $sessid = $_COOKIE['challenge'];
            //echo "Cookie value: ".$sessid;
コード例 #2
0
ファイル: test.php プロジェクト: intfrr/sqli-labs
<?php

include 'db-creds.inc';
include 'sql-connect-1.php';
include 'functions.php';
$tab = table_name();
$col = column_name(2);
$data = data($tab, $col);
echo $data;