Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Loris.php: Difference between revisions

From John's Wiki
Created page with "Useful little PHP script for holding a connection open for testing. <pre> <?php // John testing holding a connection open, will clean up. Although I guess if // you're reading this that was a lie, sorry... →‎Debug: ini_set('display_errors','1'); ini_set('display_startup_errors','1'); error_reporting (E_ALL); echo "Randomness Begin..."; function random_string($length) { $str = random_bytes($length); $str = base64_encode($str); $str = str_replace(["+", "/..."
 
No edit summary
 
Line 1: Line 1:
Useful little PHP script for holding a connection open for testing.
Useful little PHP script for holding a connection open for testing.


<pre>
<syntaxhighlight lang="php" line>
<?php
<?php
// John testing holding a connection open, will clean up. Although I guess if
// John testing holding a connection open, will clean up. Although I guess if
Line 25: Line 25:
}
}
?>
?>
</pre>
</syntaxhighlight>

Latest revision as of 21:35, 28 November 2024

Useful little PHP script for holding a connection open for testing.

<?php
// John testing holding a connection open, will clean up. Although I guess if
// you're reading this that was a lie, sorry...
/* Debug
*/
ini_set('display_errors','1');
ini_set('display_startup_errors','1');
error_reporting (E_ALL);

echo "Randomness Begin...";

function random_string($length) {
    $str = random_bytes($length);
    $str = base64_encode($str);
    $str = str_replace(["+", "/", "="], "", $str);
    $str = substr($str, 0, $length);
    return $str;
}

while (True) {
    echo random_string(32) ."\n<br>\n";
}
?>