doudi8829
2017-04-17 22:17
浏览 48
已采纳

如何将“echo”更改为PHP Class上的某些textarea或标签

I'm here to explain my website and show the "bug" or "error" that appears to my web.

Some days ago I did a page, the topic is encrypt and decrypt with AES.

Here is a screenshot:

First Screenshot

but when I crypt or decrypt something very very LONG.. look that:

Second screenshot

As you can see, the text goes on and on .. the idea I have is that when I press Encrypt / Decrypt, create a label and on that label, print the result. If it is in a label or a textarea, the text would not follow to the right, it would go down.

Here is the php code when you click on "Encrypt" / "Decrypt":

<?php

if ($_POST['direction2'])
{

include 'AES.php';
$imputText = $_POST['imputText'];
$imputKey = $_POST['imputKey'];
$blockSize = $_POST['blockSize'];
$aes = new AES($imputText, $imputKey, $blockSize);

$enc = $aes->encrypt();
$aes->setData($enc);
$dec=$aes->decrypt();
echo "Encriptado: ".$enc."<br/>";
echo "Original: ".$dec."<br/>";
}
else if($_POST['direction1'])
{

include 'AES.php';
$imputText = $_POST['imputText'];
$imputKey = $_POST['imputKey'];
$blockSize = $_POST['blockSize'];
$aes = new AES($imputText, $imputKey, $blockSize);

$enc = $aes->encrypt();
$aes->setData($enc);
$dec=$aes->decrypt();
echo "Original: ".$dec."<br/>";

$enc = $aes->decrypt();
$aes->setData($enc);
$dec=$aes->decrypt();
echo "Desencriptado: ".$dec."<br/>";

}
?>

As you can see, I print the result with an "echo".

Thanks to everyone! Hope u can help me.

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doulu7174 2017-04-17 23:09
    已采纳

    Create a css class with word-wrap: break-word, i.e.:

    .some_class {
        word-wrap: break-word;
    }
    Correct:
    <p class="some_class">vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv<p>
    
    Incorrect:  
    <p>vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv<p>

    </div>
    
    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题