SunQuest
           WAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreWAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old April 27th, 2005, 11:25 PM
wijj23 wijj23 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 2 wijj23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 10 m 16 sec
Reputation Power: 0
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!

Reply With Quote
  #2  
Old April 27th, 2005, 11:27 PM
wijj23 wijj23 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 2 wijj23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 10 m 16 sec
Reputation Power: 0
sorry, here is the formated version

PHP Code:
<?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($search110'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"?>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > wap, and php problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway