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:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old March 4th, 2008, 01:58 PM
earellano earellano is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 2 earellano User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 16 sec
Reputation Power: 0
Question WML - Passing Variables

This is my first post here, as you can see, my english is poor...

I have this files:
ressem.wml

Code:
<?php echo ("<?xml version='1.0'?>"); ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="submit" title="Resumen Semanal">
<p>
<table columns="2">
<tr><td>Semana</td><td><input type="text" name="semana" /></td></tr>

</table>
</p>
  <do type="accept">
    <go href="ressem1.wml" method="get">
      <postfield name="semana" value="$semana" />
    </go>
	Aceptar
  </do>
</card>
</wml>


and this:

ressem1.wml
Code:
<?php 
echo ("<?xml version='1.0'?>"); 
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="primera" title="Reporte">
<p>
<?php
    include('../conexion.php');
	
    $xsem = trim($_GET['semana']);
	
	$xsem = str_pad($xsem,2,'0',STR_PAD_LEFT);
	
	$query = "
	    select date_format(fecini,'%Y%m%d') as fecini, date_format(fecfin,'%Y%m%d') as fecfin
		from rh.calpro where per = '$xsem' ";
		
    $sqr = mysql_query($query);
	
    $num = mysql_num_rows($sqr);
	
	if ($num == 0) {
	    echo('Semana incorrecta');
	}

	$fila = mysql_fetch_array($sqr);
	
	$feci = $fila[fecini];
	$fecf = $fila[fecfin];
	
	echo 'Semana '.$xsem.'<br />';	
	echo 'Prendas Cortadas<br />';

	$query = "
    	select format(sum(uni_rea),0) as cortadas from pr.contrato
        where fcre_jo between '$feci' and '$fecf' ";
	$sqr = mysql_query($query);
	$fila = mysql_fetch_array($sqr);
	echo $fila[cortadas].'<br /><br />';
	echo 'Prendas Producidas<br />';

	$query = "
        select format(sum(uni_rea),0) as prod from pr.contrato 
        where ffinprd between '$feci' and '$fecf' ";
	$sqr = mysql_query($query);
	$fila = mysql_fetch_array($sqr);
	echo $fila[prod].'<br /><br />';
	
	echo '<a href="../menu.wml">Regresar</a>';

?>
</p>
</card>
</wml>


The problem is this: If I try this on a almost any wap emulator it works well, the first file ask me for a week, and then it shows on ressem1.wml the results of that week, it does with a URL like: ressem1.wml?semana=9

But when I test it on a blackberry the URL pass like this:
ressem1.wml?semana=$semana

It seem to passing the variable name instead of its contents.

I'll apreciate any help

thanks

Reply With Quote
  #2  
Old March 4th, 2008, 05:45 PM
jabba_29's Avatar
jabba_29 jabba_29 is offline
Back in HEL
Dev Shed God 8th Plane (8500 - 8999 posts)
 
Join Date: Feb 2002
Location: Finland
Posts: 8,571 jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner Folder
Time spent in forums: 3 Months 3 Weeks 2 Days 9 h 29 m 36 sec
Reputation Power: 1494
Send a message via ICQ to jabba_29 Send a message via AIM to jabba_29 Send a message via MSN to jabba_29 Send a message via Yahoo to jabba_29 Send a message via Google Talk to jabba_29 Send a message via Skype to jabba_29
Facebook
Hi earellano, welcome to Dev Shed. Enjoy your stay!!

As to the code, the are a couple of points.
1) The use of "do" - it has been a while since I delved into WAP -
is this syntax correct?
2) Try putting brackets around the variable value in the postfield: value="$(semana)" -
see if that makes a difference.

Since you are using PHP, what happens when you print_r($_REQUEST) on your emulator and your blackberry respectively -
do you notice (m)any differences..?
__________________
Cheers,

Jamie


# skiFFie | Home of the 'accessibility module' for Drupal
# Jamie Burns [me] Accessibility Module [drupal]
# guidelines | search | wap resources | not getting help | fold to cure

# Any form of employment is strictly prohibited ......


__________________

Let the might of your compassion arise to bring a quick end
to the flowing stream of the blood and tears .....
Please hear my anguished words of truth.

__________________

Reply With Quote
  #3  
Old March 10th, 2008, 05:45 PM
earellano earellano is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 2 earellano User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 16 sec
Reputation Power: 0
Quote:
Originally Posted by jabba_29
Hi earellano, welcome to Dev Shed. Enjoy your stay!!

Thans for the welcome

Quote:
Originally Posted by jabba_29
As to the code, the are a couple of points.
1) The use of "do" - it has been a while since I delved into WAP -
is this syntax correct?

It seems to be ok, I already check it twice (like santa clause).

Quote:
Originally Posted by jabba_29
2) Try putting brackets around the variable value in the postfield: value="$(semana)" -
see if that makes a difference.

It's the same effect.

Quote:
Originally Posted by jabba_29
Since you are using PHP, what happens when you print_r($_REQUEST) on your emulator and your blackberry respectively -
do you notice (m)any differences..?

It shows as follows in both:
Code:
Array ( [usuario] => $(usuario) [contra] => $(contra) )


Still needin' your help

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > WML - Passing Variables


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





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