sk3tch Posted February 13, 2009 Share Posted February 13, 2009 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 More sharing options...
The Little Guy Posted February 13, 2009 Share Posted February 13, 2009 convert_uudecode It is supposed to be a string. I also beleive you need quotes around your case like this: case 'Encode': Link to comment https://forums.phpfreaks.com/topic/145113-uudecode-and-uuencode-funtions/#findComment-761620 Share on other sites More sharing options...
sk3tch Posted February 13, 2009 Author Share Posted February 13, 2009 You don't need the qoutes. I assume the input is already a string. Did you try to run the code? Link to comment https://forums.phpfreaks.com/topic/145113-uudecode-and-uuencode-funtions/#findComment-761685 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.