|
|||
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. |
|
|||
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.. |
|
||||
I copied your code into two files, and added an echo:
Quote:
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...? |
|
|||
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> |
|
||||
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:
Last edited by Seanie; 10-10-2008 at 03:18 PM. Reason: spelled PHP wrong duh |
|
|||
|
||||
Quote:
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. |
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
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.
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.











Linear Mode

