Jump to content

uudecode and uuencode funtions


sk3tch

Recommended Posts

I was messing around with the uuencode and uudecode functions in PHP and I found some odd and was hoping someone could explain it to me.

 

If you type a word into the box and press encode, say, 5 times you will encode the word 5 times over.  But if you try to then press the decode button 5 times you are given an error.

 

Warning: convert_uudecode() [function.convert-uudecode]: The given parameter is not a valid uuencoded string in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\uu.php on line 12

 

Can someone tell me exactly what the input for the uudecode function is supposed to be?

 

<?php

$input = $_POST['input'];
$action = $_POST['action'];

switch ($action)
{
case Encode:
$output=convert_uuencode($input);
break;
case Decode:
$output=convert_uudecode($input);
break;
default:
echo "Default action returned...error.";
}

echo "\$input variable is " . $_POST["input"];

?>

<html>
<head>
<title>uu enconding/decoding tool</title>
</head>
<body>


<h3>The purpose of this form is to uuencode or uudecode input given by the user</h3>

<form action="uu.php" method="POST">
<textarea rows="10" cols="30" name="input"><?php echo $output ?></textarea>
<br /><br />
<input type="submit" value="Encode" name="action"></input>
<input type="submit" value="Decode" name="action"></input>
</form>

</body>
</html>

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/145113-uudecode-and-uuencode-funtions/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.