Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-10-2008, 07:32 PM
Novice Webmaster
 
Join Date: Aug 2008
Location: malaysia
Posts: 23
Rep Power: 0
areah is on a distinguished road
passing variable from a deck to another deck in wml

Hi...I hope someone will help me out.

I want to ask is that possible to pass variable from a deck to another deck in wml? I tried to use session_start() in php which embedded to wml to pass the variable. And then i try to echo the session in the second deck which shows nothing at all.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-10-2008, 09:33 PM
Seanie's Avatar
Senior Webmaster
 
Join Date: Mar 2008
Location: pd
Posts: 267
Rep Power: 15
Seanie has a spectacular aura about Seanie has a spectacular aura about
Still struggling?

The WML is irrelevant, it's just plain text that the PHP processor ignores and copies from source file to output. Your problem is:

Something wrong with session config on your server.
- or -
Something wrong with your PHP code.

Is your server public? Post an URL, and your current scripts.
__________________
Sean says:
Read my blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-10-2008, 03:50 PM
Novice Webmaster
 
Join Date: Aug 2008
Location: malaysia
Posts: 23
Rep Power: 0
areah is on a distinguished road
Yeah..still stuck on this. I still develop it as localhost.
Below is the summarize code whcih i have done.

login.php:
session_start();
$_SESSION['user_login']=123;


And in myprofile.php:

<?php
session_start();
$query = "SELECT * FROM ownerdetails WHERE Login_id = '" . $_SESSION['user_login'] . "' ";
$result = mysql_query($query) or die(mysql_error());

while ($row=mysql_fetch_array($result))
{
$Name=$row['Name'];
}
?>

<p> Full Name : <?php echo $Name; ?>

Nothing show..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-10-2008, 08:50 PM
Seanie's Avatar
Senior Webmaster
 
Join Date: Mar 2008
Location: pd
Posts: 267
Rep Power: 15
Seanie has a spectacular aura about Seanie has a spectacular aura about
I copied your code into two files, and added an echo:
Quote:
session_start();
echo "<p>user_login is " . $_SESSION['user_login'] . "</p>";
$query = "SELECT * FROM...
First file (with <?php...?> added) is:

http://lolyco.com/areah/login.php

Second file is:

http://lolyco.com/areah/myprofile.php

You can see there's nothing wrong with the session variable. Unless... you don't see the "123" being printed, in which case... maybe you have a bad browser, or cookies turned off, or...?
__________________
Sean says:
Read my blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 10-10-2008, 02:32 PM
Novice Webmaster
 
Join Date: Aug 2008
Location: malaysia
Posts: 23
Rep Power: 0
areah is on a distinguished road
Sorry, forget to embed in wml. If the code embeded to wml then it won't show.

login.php:
session_start();
$_SESSION['user_login']=123;


And in myprofile.php:
<wml>
<card id="myprofile" title="Profile">
<?php
session_start();
$query = "SELECT * FROM ownerdetails WHERE Login_id = '" . $_SESSION['user_login'] . "' ";
$result = mysql_query($query) or die(mysql_error());

while ($row=mysql_fetch_array($result))
{
$Name=$row['Name'];
}
?>

<p> Full Name : <?php echo $Name; ?>

</card>
</wml>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 10-10-2008, 03:17 PM
Seanie's Avatar
Senior Webmaster
 
Join Date: Mar 2008
Location: pd
Posts: 267
Rep Power: 15
Seanie has a spectacular aura about Seanie has a spectacular aura about
I added that wml markup to the two examples you posted earlier, on those URLs, and it works just fine. What do you see when you visit 'myprofile.php' on your localhost server? Do you see:
Quote:
user_login is 123
No database selected
If you don't, then perhaps you've got a problem with your web server configuration and it's not parsing the php correctly. Does it process the PHP correctly without the WML markup and incorrectly with? Maybe you've got some WML-specific settings in your httpd.conf - you don't need any. It might even be time to go back to a default httpd.conf
__________________
Sean says:
Read my blog

Last edited by Seanie; 10-10-2008 at 03:18 PM. Reason: spelled PHP wrong duh
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 12-10-2008, 09:28 PM
Novice Webmaster
 
Join Date: Aug 2008
Location: malaysia
Posts: 23
Rep Power: 0
areah is on a distinguished road
I did some changes to the script and then i tried to view it with opera. It worked perfectly.

However, i'm still stuck on how to explain nokia s60 emultor can't process it. I'm afraid it will effect the end result when i implement it to real phone.

Any suggestion?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 12-10-2008, 10:20 PM
Novice Webmaster
 
Join Date: Aug 2008
Location: malaysia
Posts: 23
Rep Power: 0
areah is on a distinguished road
I tried to use openwave simultor as well. And it shows the same error.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 12-10-2008, 11:02 PM
Novice Webmaster
 
Join Date: Aug 2008
Location: malaysia
Posts: 23
Rep Power: 0
areah is on a distinguished road
I tried to use openwave simulator as well. And it shows the same error.

Last edited by areah; 12-10-2008 at 11:27 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 13-10-2008, 12:32 AM
Seanie's Avatar
Senior Webmaster
 
Join Date: Mar 2008
Location: pd
Posts: 267
Rep Power: 15
Seanie has a spectacular aura about Seanie has a spectacular aura about
Quote:
Any suggestion?
It works in opera? Like I suggested you try 28th August?
passing array from mysql to wml using php
Wow, you've got a work rate like mine!

I suspect you'll struggle to find a useful simulator for a mobile phone website. Phones are such a restricted platform for computing, I imagine there'll be a great deal of diversity in feature support. My phone won't login to two websites I've been working on. One day I'll think about fixing it, but for now I consider the parts of the sites that need login aren't that vital for phone users.

I have two more suggestions:
1. Get a phone that you can use to check your work. You'll never be doing a real test unless you're using a real phone. Buy a few, there should be plenty available cheap second-hand. You can get a celcom prepaid sim for 10 RM or less, and it'll allow you to surf the web prepaid gprs. Use port forwarding on your router so that you can enter your home IP address into your phone to see your site.
2. Start a new thread on WMM asking members what sites they log into using a username and password from their mobile phones. I suspect it's not many, for people whose phones only have a mini-browser. I could be wrong!

It may be if 'phones cause trouble for sessions, that you'll have to develop your own session support, maybe based on URL arguments or something. PHP can do it for you apparently - see the comment at the bottom of:
PHP: Runtime Configuration - Manual
If it's cookie handling on the 'phone that's the problem, you could try this (less secure, slightly ugly) alternative.
__________________
Sean says:
Read my blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 13-10-2008, 07:51 PM
Novice Webmaster
 
Join Date: Aug 2008
Location: malaysia
Posts: 23
Rep Power: 0
areah is on a distinguished road
Can you give me the link to post in WMM?

Thanks a lot for helping me.

I will continue to post in this forum. Hope you will still follow up.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
passing array from mysql to wml using php areah Website Design 13 05-09-2008 03:16 PM
please help...shopping cart passing values to another page angie_wnv Website Programming 0 08-03-2007 05:53 PM
passing value nov8998 Website Programming 4 18-08-2004 11:15 AM
Variable in ASP kala_krayon Website Programming 4 10-08-2002 12:25 AM


All times are GMT +8. The time now is 01:31 AM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61