Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 在php文件中向输入标记插入值_Android - Fatal编程技术网

Android 在php文件中向输入标记插入值

Android 在php文件中向输入标记插入值,android,Android,如何在php文件的输入框中插入值 例如,我有这个代码 <h1><a>App Test Form</a></h1> <form id="form_6" class="digitalfuture" method="post" action="#main_body"> <div class="form_description"> <h2>

如何在php文件的输入框中插入值

例如,我有这个代码

<h1><a>App Test Form</a></h1>
        <form id="form_6" class="digitalfuture"  method="post" action="#main_body">
                    <div class="form_description">
            <h2>App Test Form</h2>
            <p></p>
        </div>                      
            <ul >

                    <li id="li_8" >
        <label class="description">Name <span id="required_8" class="required">*</span></label>
        <span>
            <input id="element_8_1" name= "element_8_1" class="element text" maxlength="255" size="8" value="hello" />
            <label>First</label>
        </span>
        <span>
            <input id="element_8_2" name= "element_8_2" class="element text" maxlength="255" size="14" value="" />
            <label>Last</label>
        </span><p class="guidelines" id="guide_8"><small>Please tell us your name</small></p> 
        </li>
App测试表
应用程序测试表

  • 名字* 弗斯特 最后 请告诉我们您的姓名
有人能指出一些对我有帮助的教程吗?

source.php:

<?php
    $data = 'text';
?>
<?php
    $data = 'text';
?>

input.php:

<?php
    include('source.php');
    echo '<input type="text" name="example" value="', $data, '" />';
?>
<?php
    include('source.php');
    echo '<input type="text" name="example" placeholder="', $data, '" />';
?>

这将在输入字段值中插入$data的内容

或者你是说别的什么

如果您想在打开页面时直接看到文本,可以在输入标记中使用html5功能“占位符”。像这样:

<input type="text" name="example" placeholder="Write your comment" />

这将在页面中显示一个输入字段,其中文本“Write your comment”在该字段中可见,直到用户单击该字段和/或写入该字段(无需手动删除占位符文本,它将自动消失)

因此,当您将它们组合在一起时,它将如下所示:

source.php:

<?php
    $data = 'text';
?>
<?php
    $data = 'text';
?>

input.php:

<?php
    include('source.php');
    echo '<input type="text" name="example" value="', $data, '" />';
?>
<?php
    include('source.php');
    echo '<input type="text" name="example" placeholder="', $data, '" />';
?>


它与android有什么关系?是的,这与php和html有关,而与android机器无关。在输入框中你到底想要什么。从数据库中弹出的值,或者只是您创建的随机文本,例如“在此处输入您的姓名?”最后一个值是通过在输入的括号中添加“占位符”atrtibute来实现的。第一个可以从数据库中提取,并放在输入字段中。然后把它放在“值”中,但你可以放在元素中。这是我制作的一个大型应用程序的一部分,其中涉及数据库和其他东西,主要功能是用户使用应用程序,完成后,他/她可以按下按钮将应用程序中的所有信息和项目发送到远程服务器,并自动填写表单,该表单将由用户自动查看admin@Dorvalla是的,我可以只使用php和html,但在用户不熟悉的情况下会涉及到一些计算因此,我使用android设备让他们的工作变得简单android设备应该负责将数据发送到网页,而不是php脚本