Postfield in WML does not pass all variables to next WML page – PHP

  php

Q(Question):

I am writing a function as listed below. My problem is that this form passes
only the variable ‘state’ and not the others.
Can somebody help me?

Thanks,

Gustaaf
function SelectIndia($land,$mcc,$opco,$iru,$cc) {

print ‘Staat: <select name="state">
<option value="AP">Andhra Pradesh</option>
<option value="AR">Arunachal Pradesh</option>
<option value="AS">Assam</option>
<option value="BH">Bihar</option>
<option value="CH">Chennai/Madras</option>
<option value="CG">Chatisgargh</option>
<option value="DE">Dehli</option>
<option value="MA">Goa</option>
<option value="GU">Gujarat</option>
<option value="HA">Haryana</option>
<option value="HI">Himachal Pradesh</option>
<option value="JA">Jammu / Kashmir</option>
<option value="JH">Jharkland</option>
<option value="KA">Karnataka</option>
<option value="KE">Kerala</option>
<option value="KO">Kolkata/Calcutta</option>
<option value="MP">Madhya Pradesh</option>
<option value="MA">Maharashtra</option>
<option value="MN">Manipur</option>
<option value="ME">Meghalaya</option>
<option value="MB">Mumbai/Bombay</option>
<option value="NA">Nagaland</option>
<option value="NI">Nizoram</option>
<option value="OR">Orissa</option>
<option value="PO">Pondicherry</option>
<option value="PU">Punjab</option>
<option value="RA">Rajasthan</option>
<option value="TN">Tamil Nadu</option>
<option value="TR">Tripura</option>
<option value="UE">Uttar Pradesh East</option>
<option value="UW">Uttar Pradesh West</option>
<option value="UT">Uttaranchal</option>
<option value="WB">West Bengal</option>
</select>

<br/>

<anchor>
Selecteer
<go href="roamform.php" method="get">
<postfield name="opco" value="$(opco)"/>
<postfield name="type" value="2"/>
<postfield name="state" value="$(state)"/>
<postfield name="lnd" value="$(land)"/>
<postfield name="iru" value="$(iru)"/>
<postfield name="cc" value="$(cc)"/>
<postfield name="mcc" value="$mcc"/>
</go>
</anchor>’;

}

A(Answer):

"uitbundig" <ri******@vodafone.nl> wrote in message
news:bv**********@news1.tilbu1.nb.home.nl…

I am writing a function as listed below. My problem is that this form
passes only the variable ‘state’ and not the others.

There are no "anchor", "go" and "postfield" tags in HTML. So, it is not an
PHP-problem but an HTML-problem.

Gerard van Wilgen

www.majstro.com (On-line translation dictionary / Enreta tradukvortaro)
www.travlang.com/Ergane (Free translation dictionary for Windows / Senpaga
tradukvortaro por Windows)

A(Answer):

On 2004-01-30, Gerard van Wilgen <gv********@planet.nl> wrote:

"uitbundig" <ri******@vodafone.nl> wrote in message
news:bv**********@news1.tilbu1.nb.home.nl…

I am writing a function as listed below. My problem is that this form

passes

only the variable ‘state’ and not the others.

There are no "anchor", "go" and "postfield" tags in HTML. So, it is not an
PHP-problem but an HTML-problem.

Thats why the topic says: WML instead of HTML

Anway, for the op: here is a working example
http://www.codehelp.co.uk/php/wap8.php

http://home.mysth.be/~timvw

A(Answer):

Tim,

I appreciate your help. I can see they use also php-variables in the
postfield variable. Instead of using <anchor> … </anchor> tags they use
<do type…> ….. </do> tags.
I have tried that code but the same problem stays. In my example the only
variable which is filled is the variable from the <select><option…> tags.
Just a simple example php-code again:

$id = ‘abc’;

print ‘
Staat:
<select name="state">
<option value="AP">Andhra Pradesh</option>
<option value="WB">West Bengal</option>
</select>’;

print ‘
<anchor>Accoord
<go href="form.php" method="get">
<postfield name="tp" value="m"/>
<postfield name="id" value="$id"/>
<postfield name="state" value="$state"/>
</go>
</anchor>’;

What you see in the get-string is: www.ditz.nl/form.php?tp=m&id=&state=AP

You see that the variable ‘tp’ has the given value, that the variable ‘id’
is empty and that the variable ‘state’ has given the value from the ‘option’
tags. My problem is that the variable ‘id’ has no value although I have set
this varible to the value ‘abc’.

Please your suggestions.

Gustaaf

"Tim Van Wassenhove" <eu**@pi.be> wrote in message
news:bv************@ID-188825.news.uni-berlin.de…

On 2004-01-30, Gerard van Wilgen <gv********@planet.nl> wrote:

"uitbundig" <ri******@vodafone.nl> wrote in message
news:bv**********@news1.tilbu1.nb.home.nl…

I am writing a function as listed below. My problem is that this form

passes

only the variable ‘state’ and not the others.

There are no "anchor", "go" and "postfield" tags in HTML. So, it is not
an PHP-problem but an HTML-problem.

Thats why the topic says: WML instead of HTML

Anway, for the op: here is a working example
http://www.codehelp.co.uk/php/wap8.php

http://home.mysth.be/~timvw

A(Answer):

uitbundig <ri******@vodafone.nl> wrote:

First: please don’t TOFU.

print ‘
…. <postfield name="id" value="$id"/>
<postfield name="state" value="$state"/>
…. </anchor>’;

You see that the variable ‘tp’ has the given value, that the variable ‘id’
is empty and that the variable ‘state’ has given the value from the ‘option’
tags. My problem is that the variable ‘id’ has no value although I have set
this varible to the value ‘abc’.

Read up on strings and the expansion of variables:
http://www.php.net/manual/en/language.types.string.php

Daniel Tryba

A(Answer):

Daniel, what is TOFU?

Further I have solved the problem now.
The solution is:

Instead of
print ‘<postfield name="id" value="$id"/>’;
you have to write
print ‘<postfield name="id" value="’.$id.’"/>’;

This works fine.

Thanks for your help.

Gustaaf

"uitbundig" <ri******@vodafone.nl> wrote in message
news:bv**********@news2.tilbu1.nb.home.nl…

Tim,

I appreciate your help. I can see they use also php-variables in the
postfield variable. Instead of using <anchor> … </anchor> tags they use
<do type…> ….. </do> tags.
I have tried that code but the same problem stays. In my example the only
variable which is filled is the variable from the <select><option…>
tags. Just a simple example php-code again:

$id = ‘abc’;

print ‘
Staat:
<select name="state">
<option value="AP">Andhra Pradesh</option>
<option value="WB">West Bengal</option>
</select>’;

print ‘
<anchor>Accoord
<go href="form.php" method="get">
<postfield name="tp" value="m"/>
<postfield name="id" value="$id"/>
<postfield name="state" value="$state"/>
</go>
</anchor>’;

What you see in the get-string is: www.ditz.nl/form.php?tp=m&id=&state=AP

You see that the variable ‘tp’ has the given value, that the variable ‘id’
is empty and that the variable ‘state’ has given the value from the
‘option’ tags. My problem is that the variable ‘id’ has no value although I have
set this varible to the value ‘abc’.

Please your suggestions.

Gustaaf

"Tim Van Wassenhove" <eu**@pi.be> wrote in message
news:bv************@ID-188825.news.uni-berlin.de…

On 2004-01-30, Gerard van Wilgen <gv********@planet.nl> wrote:

"uitbundig" <ri******@vodafone.nl> wrote in message
news:bv**********@news1.tilbu1.nb.home.nl…
> I am writing a function as listed below. My problem is that this form
passes
> only the variable ‘state’ and not the others.

There are no "anchor", "go" and "postfield" tags in HTML. So, it is

not

an PHP-problem but an HTML-problem.

Thats why the topic says: WML instead of HTML

Anway, for the op: here is a working example
http://www.codehelp.co.uk/php/wap8.php

http://home.mysth.be/~timvw

A(Answer):

uitbundig <ri******@vodafone.nl> wrote:

Daniel, what is TOFU?

$ dict tofu
2 definitions found

From WordNet (r) 2.0 [wn]:

tofu
n : cheeselike food made of curdled soybean milk [syn: {bean
curd}]

From Virtual Entity of Relevant Acronyms (Version 1.9, June 2002) [vera]:

TOFU
Text Oben, Full-quote Unten (telecommunication-slang, Usenet)

Guess which one I mean :). Why? http://www.leerquoten.nl/ (in dutch)
Further I have solved the problem now.
The solution is:

Instead of
print ‘<postfield name="id" value="$id"/>’;
you have to write
print ‘<postfield name="id" value="’.$id.’"/>’;

This works fine.

Or one of the many other ways to generate strings, like :
print "<postfield name=’id’ value=’$id’/>";
(unless WML dicates attributes to be in ")

[snip 76 lines]

Daniel Tryba

LEAVE A COMMENT