|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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. __________________ |
|
#3
|
||||||
|
||||||
|
Quote:
Thans for the welcome Quote:
It seems to be ok, I already check it twice (like santa clause). Quote:
It's the same effect. Quote:
It shows as follows in both: Code:
Array ( [usuario] => $(usuario) [contra] => $(contra) ) Still needin' your help |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > WAP Programming > WML - Passing Variables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|