<?php
header("Content-Type: text/html; charset=utf-8");
$code=$_POST['code'];
foreach ($_POST as $key=>$value) {
if ($key == "URL") {
if ($value=='Decode') {
$code=urldecode($code);
}
else $code=urlencode($code);
}
if ($key == "Base64") {
if ($value=='Decode') {
$code=base64_decode($code);
}
else $code=base64_encode($code);
}
}
?>
<html>
<body style="text-align: left;">
<form action="" method='post'>
<textarea name='code' style="width:90%;height:45%;"><?php echo $_POST['code'];?></textarea>
<table>
<tbody>
<tr><td align="center">
<input type="submit" name="URL" value="Encode">
</td><td align="center">
URL
</td><td align="center">
<input type="submit" name="URL" value="Decode">
</td></tr>
<tr><td align="center">
<input type="submit" name="Base64" value="Encode">
</td><td align="center">
Base64
</td><td align="center">
<input type="submit" name="Base64" value="Decode">
</td></tr>
</tbody>
</table>
</form>
<textarea name='code' style="width:90%;height:45%;"><?php echo ($code);?></textarea>
</body>
</html>
标签:none