0

I wrote the following code

<?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>

the problem How I print the entered value in input text inside php code.

bigStar
  • 1
  • 1

2 Answers2

1

First of all, you need to define a form in your markup if you want the input fields to do anything. The form should have an action and a method attribute.

Then you can use the $_GET or $_POST superglobal arrays to access the data in the following manner:

echo $_POST['title'];
code_burgar
  • 12,025
  • 4
  • 35
  • 53
  • you are right,but I enter a big text in the input text so it's difficult using $_Get ,and $_Post dosn't support in my wap version.is there way to put them in one file ?? – bigStar Apr 22 '11 at 14:10
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.

coloboxp
  • 494
  • 8
  • 15