Base64_encode and Internal Server Error
Moderator: General Moderators
Base64_encode and Internal Server Error
I made a script that would do base64_encode to a string 3 times and it worked fine. Then, to raise the bar (a ton) I had it do it 64 times to the string. Now when I try to use it, I get "Internal Server Error", I use a webhost. What causes it? Is a certain restriction stopping it? I realize 64 times is a ton, but I wanted to try it.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Code: Select all
<?php
// Base64 experimentation
if ($q == null)
{die("No query specified");}
elseif ($q == "encode")
{
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
$txt = base64_encode($txt);
echo ($txt);
}
elseif ($q == "decode")
{
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
$txt = base64_decode($txt);
echo ($txt);
}
?>You have to goto the page and add "?q=encode&txt=<what_you_want_to_encode>" to use it.
isn't that what loops are for?
Code: Select all
<?php
// Base64 experimentation
$i = 64;
if ($q == null){
die("No query specified");
} elseif ($q == "encode") {
while($i-->0) {
$txt = base64_encode($txt);
}
echo ($txt);
} elseif ($q == "decode") {
while($i-->0) {
$txt = base64_decode($txt);
}
echo ($txt);
}
?>