Results 1 to 11 of 11

Thread: passing variable from a deck to another deck in wml

  1. #1
    Join Date
    Aug 2008
    Location
    malaysia
    Posts
    31
    Rep Power
    0

    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.

  2. #2
    Join Date
    Mar 2008
    Location
    pd
    Posts
    497
    Rep Power
    148
    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.

  3. #3
    Join Date
    Aug 2008
    Location
    malaysia
    Posts
    31
    Rep Power
    0
    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..

  4. #4
    Join Date
    Mar 2008
    Location
    pd
    Posts
    497
    Rep Power
    148
    I copied your code into two files, and added an echo:
    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...?

  5. #5
    Join Date
    Aug 2008
    Location
    malaysia
    Posts
    31
    Rep Power
    0
    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>

  6. #6
    Join Date
    Mar 2008
    Location
    pd
    Posts
    497
    Rep Power
    148
    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:
    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
    Last edited by Seanie; 10-10-2008 at 03:18 PM. Reason: spelled PHP wrong duh

  7. #7
    Join Date
    Aug 2008
    Location
    malaysia
    Posts
    31
    Rep Power
    0
    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?

  8. #8
    Join Date
    Aug 2008
    Location
    malaysia
    Posts
    31
    Rep Power
    0
    I tried to use openwave simultor as well. And it shows the same error.

  9. #9
    Join Date
    Aug 2008
    Location
    malaysia
    Posts
    31
    Rep Power
    0
    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.

  10. #10
    Join Date
    Mar 2008
    Location
    pd
    Posts
    497
    Rep Power
    148
    Any suggestion?
    It works in opera? Like I suggested you try 28th August?
    http://www.webmastermalaysia.com/web...html#post79269
    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.

  11. #11
    Join Date
    Aug 2008
    Location
    malaysia
    Posts
    31
    Rep Power
    0
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

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