第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

Ajax 搜索結(jié)果,點(diǎn)擊結(jié)果下載文件

Ajax 搜索結(jié)果,點(diǎn)擊結(jié)果下載文件

PHP
HUWWW 2022-06-17 15:58:22
我的索引頁(yè)    <html>         <head>          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />          <title>Some name</title>          <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>          <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>          <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />         </head>         <body>          <div class="container">           <br />           <h2 align="center">Search by name</h2><br />           <div class="form-group">            <div class="input-group">             <span class="input-group-addon">Search</span>             <input type="text" name="search_text" id="search_text" placeholder="Enter model / search here" class="form-control" />            </div>           </div>           <br />           <div id="result"></div>          </div>         </body>        </html>    <script>    $(document).ready(function(){     load_data();     function load_data(query)     {      $.ajax({   url:"fetch.php",   method:"POST",   data:{query:query},   success:function(data)   {    $('#result').html(data);   }  }); } $('#search_text').keyup(function(){  var search = $(this).val();  if(search != '')  {   load_data(search);  }  else  {   load_data();  } });});</script>AND MY fetch.php PAGE,用于從數(shù)據(jù)庫(kù)表中獲取數(shù)據(jù)并輸出結(jié)果。我還添加了如果結(jié)果 > 50 它會(huì)要求輸入更多字符,因?yàn)槿绻也惶砑?if result > 50 那么我的頁(yè)面需要 20 秒才能顯示所有數(shù)據(jù),因?yàn)槲业臄?shù)據(jù)庫(kù)表有 25000 個(gè)條目。我想要我的每個(gè)結(jié)果的 href 鏈接,并且在點(diǎn)擊時(shí),它應(yīng)該從數(shù)據(jù)庫(kù)表中的 ./"URL" 列下載一個(gè)文件。我的數(shù)據(jù)庫(kù)如下所示:我當(dāng)前的頁(yè)面是http://mss1996.ddns.net:8008/files我嘗試在 outpur'array' 中添加 <a href=".$row["URL"]."> 但它破壞了我的頁(yè)面。
查看完整描述

1 回答

?
海綿寶寶撒

TA貢獻(xiàn)1809條經(jīng)驗(yàn) 獲得超8個(gè)贊

如果該字段的內(nèi)容確實(shí)是有效的 URL,您應(yīng)該能夠輕松地添加該URL字段以形成有效的 URL。我看到您的代碼中缺少的內(nèi)容是http或者https如果它是外部鏈接。如果它是頁(yè)面內(nèi)的相對(duì)鏈接,那么您就可以了。然后添加</a>關(guān)閉鏈接。所以你會(huì)像這樣形成你的表格列:

echo '<td><a href="' . $row['URL'] . '">' . $row["URL"] . '</a></td>';


查看完整回答
反對(duì) 回復(fù) 2022-06-17
  • 1 回答
  • 0 關(guān)注
  • 123 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)