douqing0713 2009-10-01 17:33
浏览 68
已采纳

如何从PHP中检索HTML文本框的内容以响应按钮单击?

What is the best way to put a text box on the following HTML page and then, without reloading the page, get its content in PHP when the user clicks the button?

<?php require_once "phpuploader/include_phpuploader.php" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Simple File Upload - use SaveDirectory property</title>
    <link href="demo.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div class="demo">
        <h2>Attach some files</h2>
        <p>Attach some files using the button below.</p>
        <ul>
            <li>Allowed file types is set to: jpg, gif, png, zip 
                       - multiple files (Max 10M)</li>
        </ul>

        <?php
            $uploader=new PhpUploader();

            $uploader->MultipleFilesUpload=true;
            $uploader->InsertText="Upload Now";

            $uploader->MaxSizeKB=10240;
            $uploader->AllowedFileExtensions="jpeg,jpg,gif,png,zip";

            $uploader->SaveDirectory="savefiles";

            $uploader->Render();
        ?>          
    </div>
</body>
</html>

I know I can use form and Post but I want to stay on the same page.

  • 写回答

3条回答 默认 最新

  • dp411805872 2009-10-01 17:35
    关注

    Technically if you make the form post to itself, you will stay on the same page. That aside, your only solution is AJAX.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度