0

我写了以下代码

<?xml version="1.0" ?>
<wml>
<card>
 title : <input type="text" name="title" /><br/>
 body : <input type="text" name="body" /><br/>
<?php 
echo $(title)
?>
</card>
</wml>

问题我如何在 php 代码中的输入文本中打印输入的值。

4

2 回答 2

1

首先,如果您希望输入字段执行任何操作,您需要在标记中定义一个表单。表单应该有一个action和一个method属性。

然后您可以使用$_GET$_POST超全局数组以下列方式访问数据:

echo $_POST['title'];
于 2011-04-22T13:37:22.947 回答
0

If you want to print the content of a variable directly in the screen of the device (or printer if it is an extended WML browser) you need to do it like this:

$(varName)

In your sample you are setting the value from a server variable, not from the device's memory.

A bit late answer but may help someone, WML is not so common anymore but still it is being used for banking and other kind of automated dispensers.

于 2013-11-08T15:09:13.500 回答