duanqiao8925 2014-07-22 19:28
浏览 35

html使用php添加项目和显示列表

I am new in HTML

i want to make a user list web page. The page reads user.txt and show then left column of the tabel.

And new items in which New User column will be added to user.txt list

Instead of get/post http methos i am trying to use 2 AJAX methods to communicate the server side.

After sending url with AJAX i will call php scripts on the server side

I think first AJAX method for adding is below

XMLHttpRequestObject.open("GET", dataSource);

However. I coulnt find the second. And i dont know how to implement

Here is my code

<!DOCTYPE html>
<SCRIPT language="javascript">
function add(nm, ml) { }
function read(nam,mail) { }
</SCRIPT>

<html>
<body>

  <table border = "1">
   <thead>
     <tbody>
        <tr>
          <th>Registered Users</th>
          <th>New User</th>
        </tr>

         <tr>
          <td></br></td>
          <td>
              <p><label>Name:
                   <input name = "name" type = "text">

              <p><label>Email:
                   <input name = "email" type = "text">
          </td>
        </tr>

        <tr>
         <td> 
          <p></p>

           <button onclick="read()">Read users list</button>
         </td>

        <td> 
          <p></p>

          <button onclick="add(name,email)">Add user to list</button>

          <p id="demo2"></p>
        </td> 
        </tr>
     </tbody>
   </thead>
  </table> 
</body>
</html>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 划分vlan后不通了
    • ¥15 GDI处理通道视频时总是带有白色锯齿
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)
    • ¥15 自适应 AR 模型 参数估计Matlab程序
    • ¥100 角动量包络面如何用MATLAB绘制
    • ¥15 merge函数占用内存过大
    • ¥15 使用EMD去噪处理RML2016数据集时候的原理
    • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大