|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
wap, and php problem
Hey guys, I seem to have a problem that I cannot figure out.
I am not sure whether this is an wml, or php problem, but here it goes... <?php header("Content-Type: text/vnd.wap.wml;charset=utf-8"); echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"; echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"" . " \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n"; echo "<wml>\n"; echo "<template><onevent type='onenterbackward'><refresh><setvar name='search1' value=''/></refresh></onevent><onevent type='onenterforward'><refresh><setvar name='search1' value=''/></refresh></onevent></template>"; echo "<card id='Home' title='ISBN'>\n"; $search1 = (isset($_POST['search']) ? $_POST['search'] : ''); $sl = strlen($search1); if ($sl < 10 && $sl > 0) { $search1 = str_pad($search1, 10, 'x', STR_PAD_RIGHT); } echo "<p>ISBN (omit"X"):</p>"; echo "<p><input type='text' name='search1' format='*N'/></p>"; echo "<p><anchor title='Fetch'>Fetch<go href='http://localhost/wap/istlib.php' method='post'>"; echo "<postfield name='search' value='$(search1)'/>\n"; echo "</go></anchor></p>\n"; echo "</card>\n"; echo "</wml>\n"; ?> This seems to be the hotspot of the problem... echo "<postfield name='search' value='$(search1)'/>\n"; now the script functions as it should for the most part, except for utilizing the str_pad function, which I really need to work. but I know that php needs the variable to be as such $search1, but that causes a wml error. If anyone can help, I would be greatful! |
|
#2
|
|||
|
|||
|
sorry, here is the formated version
PHP Code:
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > WAP Programming > wap, and php problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|