weixin_33698823 2014-12-17 18:07 采纳率: 0%
浏览 11

PHP计数器输入字段

Hi i use this PHP script http://www.stevedawson.com/scripts/text-counter.php

And to make it appear on my html page i use this ajax script.

<script>

$.ajax({
    type:'GET',
    url:'http://www.solariserat.se/count.php',
    data:'',
    success: function(data){
            $('#container').html(data);
    }
});

</script>

Together with this html code

<div id="container">    
<?php include "count.php"; ?>
</div>

And it works perfect and it displays the counted numbers inside the div.

But i want it to be displayed as value inside a input tag Is this possible, and how do i do it?

I know this is wrong but you get my point what i want to do =)

<input value="count.php">
  • 写回答

3条回答 默认 最新

  • weixin_33704591 2014-12-17 18:08
    关注

    This should work:

    <input value="<?php include "count.php"; ?>">
    

    However a cleaner approach would be to include the count value in the PHP page that is rendering the <input> so you can do something like this:

    <input value="<?= count ?>">
    
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#网络安全#的问题:求ensp的网络安全,不要步骤要完成版文件
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥20 使用Photon PUN2解决游戏得分同步的问题
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序