gpt4 book ai didi

php - html 表单代码中的参数列表后缺少 )

转载 作者:行者123 更新时间:2023-12-02 20:47:26 25 4
gpt4 key购买 nike

我正在尝试使用以下代码在弹出窗口中显示 $formcode,它是表单的 html 代码。我知道这不是一个理想的方法,但我想了解为什么它不起作用。

<?php
$blah = "Well"; $test = "Done";
echo '<script type="text/javascript" src="fetchlayers.js"></script>';
$formcode = "<form action=\"process.php\" method=\"post\" enctype=\"multipart/form-data \"><label for=\"file\">Filename:</label><input type=\"file\" name=\"file\" id=\"file\"/> <br /><input type=\"submit\" name=\"submit\" value=\"Submit\" onclick=\"setTimeout(function() { alert('$blah'); },1250);\" /></form>";


echo "<h1>hello</h1>
<div id='form'>
<a href='#' onclick=\"createpopup('" . htmlentities($formcode) . "'); return false;\">
click here</a>
</div>";

在 Firebug 中,我在参数列表后丢失了 ) ,这看起来有点随意,因为那里有正确数量的括号。

最佳答案

我不确定是不是这个,因为我无法测试它,但请检查alert('$blah')

我认为应该是\'

alert(\'$blah\')

关于php - html 表单代码中的参数列表后缺少 ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/832615/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com