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:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old January 2nd, 2006, 12:54 AM
utsboy utsboy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Jakarta
Posts: 16 utsboy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 22 m 26 sec
Reputation Power: 0
Send a message via Yahoo to utsboy
Question Errors and compatibility problems using session in WML....

Dear Guys,
I 've found out some errors and compatibilty issues when testing and implemented session in wml.
When I implemented session in WML and displaying link with reference, some phones can not display it and reply no gateway information.
Especially old phones which not xHTML enable. And when I tested using WML browser or other phones with xHTML enable with it, it's oke and displayed it correctly.
Is that an compatibilities issues about this...??
Or anyone have same experiences about this.. please share it with me.
I would very appreciate for any response from you guys...

This is my test wml script :
cre_sesi.php (create session)

<?session_register("var_x");?>
<?session_register("var_x");?>
<?php
header("Content-type: text/vnd.wap.wml");
header("Pragma: no-cache");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>

<wml>
<card id="Session" title="Session Trial">
<p>
<?
$var_x = "123456";
print ("Session : " . session_id() . "<br/>");
print ("Inside session : $var_x");
$value = "10";
$link = "<a href='ba_sesi.php?sendv=$value'><Read Session></a>";
echo $link;
?>
</p>
</card>
</wml>


re_sesi.php (read session)

<?session_start();?>
<?php
header("Content-type: text/vnd.wap.wml");
header("Pragma: no-cache");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>

<wml>
<card id="Read" title="Read Sesion">
<p>
<?
$sendv=$HTTP_GET_VARS['sendv'];
$var_x = $_SESSION["var_x"];
print ("SID : " . session_id() . "<br/>");
print ("Values : $var_x");
echo "<br/>$sendv";
$link = "<a href=\"ba_sesi2.php?sendv=$sendv\"><Read Session></a>";
echo $link;
?>
</p>
</card>
</wml>


Regards,
Utsboy

Reply With Quote
  #2  
Old January 3rd, 2006, 06:37 AM
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,660 jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th 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 4 Days 1 h 21 m 33 sec
Reputation Power: 1618
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
Please use PHP tages, not PHPNET

Don't have much time to scan what the porblem is, but you are using old PHP and you don't have sessions_start on the first page. You may also be outputting stuff to the device before all headers are sent.
For example:
wml Code:
Original - wml Code
    <?session_register("var_x");?> <?session_register("var_x");?> <?php header("Content-type: text/vnd.wap.wml"); header("Pragma: no-cache"); echo "<?xml version=\"1.0\"?>"; echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"" . " \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; ?>

This snippet may be getting confused by the usage of short tags (<?)
and you also session_register twice (note that
unless you are using pre-4.2 PHP, this is out-dated method) and
perhaps a gap between the ? and the actual PHP would help...

You don't have session_start() which is the correct way to start the session.


wml Code:
Original - wml Code
    <?php session_start(); header("Content-type: text/vnd.wap.wml"); header("Pragma: no-cache"); $_SESSION["var_x"] = "123456"; $var_x = $_SESSION["var_x"]; echo "<?xml version=\"1.0\"?>"; echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"" . " \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; ?> <wml> <card id="Session" title="Session Trial"> <p> <?php print ("Session : " . session_id() . "<br/>"); print ("Inside session : $var_x"); $value = "10"; $link = "<a href='ba_sesi.php?sendv=$value'><Read Session></a>"; echo $link; ?> </p> </card> </wml>
This link also points to a page that you haven't given code for
If the link is re_sesi.php, then that should be something like:
wml Code:
Original - wml Code
    <?php session_start(); header("Content-type: text/vnd.wap.wml"); header("Pragma: no-cache"); $var_x = $_SESSION["var_x"]; $sendv=$_GET['sendv']; echo "<?xml version=\"1.0\"?>"; echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"" . " \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; ?> <wml> <card id="Read" title="Read Sesion"> <p> <?php print ("SID : " . session_id() . "<br/>"); print ("Values : $var_x"); echo "<br/>$sendv"; $link = "<a href=\"ba_sesi2.php?sendv=$sendv\"><Read Session></a>"; echo $link; ?> </p> </card> </wml>

Hope this helps a bit.
__________________
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 January 3rd, 2006, 09:09 PM
utsboy utsboy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Jakarta
Posts: 16 utsboy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 22 m 26 sec
Reputation Power: 0
Send a message via Yahoo to utsboy
Question Still not works in the old phone...

Dear Jabba,
Thx for the immediate response from you Jabba, Iam very appreciate it.
Btw Jabba, I have already tried your suggestion but actually the result is still the same, it is works only in wap browser or newer version of phones with xhtml option available but not in the old version of phones which not xhtml available and it's replied "no gateway".
I thing the problem is in the entity reference of the links, because when I hide the links in cre_sesi.php, it works but still can not pass some information to other page like (entity - reference functions) below :

PHP Code:
<?php
session_start
();
header("Content-type: text/vnd.wap.wml");
header("Pragma: no-cache");
$_SESSION["var_x"] = "123456";
$var_x $_SESSION["var_x"];
echo 
"<?xml version=\"1.0\"?>";
echo 
"<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
   
" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>

<wml>
    <card id="Session" title="Session Trial">
        <p>
<?
print ("Session : " session_id() . "<br/>");
print (
"Inside session : $var_x");
$value "10";
<
span class="highlight">//$link = "<a href='ba_sesi.php?sendv=$value'><Read Session></a>";
//echo $link;</span>
?>
              </p>
        </card>
</wml>


Do anyone knows what caused this, or session its only works in XHTML not in WML.
I would very appreciate for any response, thx in advance.

Best Regards,
Utsboy

Quote:
Originally Posted by utsboy
Dear Guys,
I 've found out some errors and compatibilty issues when testing and implemented session in wml.
When I implemented session in WML and displaying link with reference, some phones can not display it and reply no gateway information.
Especially old phones which not xHTML enable. And when I tested using WML browser or other phones with xHTML enable with it, it's oke and displayed it correctly.
Is that an compatibilities issues about this...??
Or anyone have same experiences about this.. please share it with me.
I would very appreciate for any response from you guys...

This is my test wml script :
cre_sesi.php (create session)

<?session_register("var_x");?>
<?session_register("var_x");?>
<?php
header("Content-type: text/vnd.wap.wml");
header("Pragma: no-cache");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>

<wml>
<\card id="Session" title="Session Trial">
<p>
<?
$var_x = "123456";
print ("Session : " . session_id() . "<br/>");
print ("Inside session : $var_x");
$value = "10";
$link = "<a href='ba_sesi.php?sendv=$value'><Read Session></a>";
echo $link;
?>
</p>
</card>
</wml>


re_sesi.php (read session)

<?session_start();?>
<?php
header("Content-type: text/vnd.wap.wml");
header("Pragma: no-cache");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>

<wml>
<card id="Read" title="Read Sesion">
<p>
<?
$sendv=$HTTP_GET_VARS['sendv'];
$var_x = $_SESSION["var_x"];
print ("SID : " . session_id() . "<br/>");
print ("Values : $var_x");
echo "<br/>$sendv";
$link = "<a href=\"ba_sesi2.php?sendv=$sendv\"><Read Session></a>";
echo $link;
?>
</p>
</card>
</wml>


Regards,
Utsboy

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > Errors and compatibility problems using session in WML....


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 5 hosted by Hostway