Trying to get a input/form in a script to become multiline. At the moment the script will just convert the single string. I want to make it into a bulk convert which will convert multiple strings (one on each line) Script can be seen in action here: http://idnaconv.phlymail.de/ Trying to make the simple change so it will convert in bulk, like here: punycoder .com <?php $encoded = ''; $decoded = ''; $add = ''; header('Content-Type: text/html; charset=UTF-8'); require_once('idna_convert.class.php'); $IDN = new idna_convert(); if (isset($_REQUEST['encode'])) { $decoded = isset($_REQUEST['decoded']) ? stripslashes($_REQUEST['decoded']) : ''; $encoded = $IDN->encode($decoded); } if (isset($_REQUEST['decode'])) { $encoded = isset($_REQUEST['encoded']) ? stripslashes($_REQUEST['encoded']) : ''; $decoded = $IDN->decode($encoded); } if (isset($_REQUEST['lang'])) { if ('de' == $_REQUEST['lang'] || 'en' == $_REQUEST['lang']) $lang = $_REQUEST['lang']; $add .= '<input type="hidden" name="lang" value="'.$_REQUEST['lang'].'" />'."\n"; } else { $lang = 'en'; } ?> <!DOCTYPE html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>phlyLabs Punycode Converter</title> <meta name="author" content="phlyLabs"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body> <table> <tr> <td align="right"> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get"> <input type="text" name="decoded" value="<?php echo htmlentities($decoded, null, 'UTF-8'); ?>" size="48" maxlength="255" /><br /> <input type="submit" name="encode" value="Encode >>" /><?php echo $add; ?> </form> </td> <td align="left"> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get"> <input type="text" name="encoded" value="<?php echo htmlentities($encoded, null, 'UTF-8'); ?>" size="48" maxlength="255" /><br /> <input type="submit" name="decode" value="<< Decode" /><?php echo $add; ?> </form> </td> </tr> </table> </body> </html> Code (markup): Thanks for any help or direction. +Rep
instead of <input type="text" name="decoded" value="<?php echo htmlentities($decoded, null, 'UTF-8'); ?>" size="48" maxlength="255" /> PHP: Use: <textarea name="decoded" cols="28" maxlength="255" rows="7"><?php echo htmlentities($decoded, null, 'UTF-8');</textarea> PHP: and the same on "encoded"
Yes, i have tried that although only the first term in the text area gets converted. Still not working..