0
JavaScript 경고 상자를 PHP 코드에 포함시키고 텍스트에 변수 값을보고 싶습니다. 다음 코드는 multiline을 제공하지만 변수를 사용할 수는 없습니다.PHP 코드에 다중 행 경고 상자 포함하기
?>
<script type="text/javascript">
alert("Total size of all files too large.\nConsider uploading files in smaller sets.\nYou can append to existing sets.");
document.location.href="SomewhereElse.php";
</script>
<?php
다음 코드는 변수를 사용할 수는 있지만 여러 줄을 제공하지는 않습니다.
$Str="Total size cannot be not more than " . ini_get('post_max_size');
echo "<script type='text/javascript'>\n";
echo "alert('" . $Str . "');";
echo "</script>";
이 코드를 사용해도 경고 상자가 나타나지 않습니다.
$Str="Unable to load (all of) these files because of their (total) size" .
"\nPlease make the upload set conform to the following parameters";
echo "<script type='text/javascript'>\n";
echo "alert('" . $Str . "');";
echo "</script>";
제발 \ n (제발하기 전에)을 껐다가 두 번하지 않으면 경고 상자가 나타납니다. \ n 경고 상자를 닫으면 궁금합니다. 여하튼, 변수가있는 여러 줄 경고 상자를 얻으려면 어떻게해야합니까? 이 같은