【问题标题】:Set "url" in Form with Fileupload [closed]使用 Fileupload 在表单中设置“url”[关闭]
【发布时间】:2019-05-25 22:29:37
【问题描述】:

我想将 URL 设置为 account.php?action=...,但它总是将 URL 设置为 account.php?file=... 我怎样才能避免这种情况?

<form action="account.php?action=uploadprofileimage" enctype="multipart/form-data">
    <div id="uploadprofileimagewrapper">
        <input id="uploadprofileimage" type="file" name="file" onchange="form.submit()">
    </div>
</form>

那么我该如何设置“URL”呢?

我想禁用file=... 或在必要时在 URL 中同时使用file=... 和 action=...

感谢您的帮助

【问题讨论】:

    标签: php html forms web


    【解决方案1】:

    您应该在&lt;form&gt; 中添加method 属性并设置为post:

    <form action="account.php?action=uploadprofileimage" enctype="multipart/form-data" method="post">
        <div id="uploadprofileimagewrapper">
            <input id="uploadprofileimage" type="file" name="file" onchange="form.submit()">
        </div>
    </form>
    

    另请参阅:HTML form enctype Attribute

    【讨论】:

    • 谢谢兄弟....我太笨了...我怎么能忘记...
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多