×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    2

    back button problem - need hlp.

    Hi there!
    here is my problem:
    When user logs-in : he is authenticated, and if success directed to
    mainMenu page. So the url of mainMenu is http://127...../login.do?
    un=t&pw=t

    There are some Lins on mainMenu page to navigate in the site. When i
    click on some link say "view profile" and hit "back button" to come
    back to my previous page - it is obviously taking me to the
    http://127..../login.do?un=t&pw=t url. But unlike IE or other PC
    browsers which just display the page, it is performing the login.do?
    action again and authenticating the user automatically and then
    taking me to mainMenu. Here I am saved, as it isn't causing any big
    problem.

    But this continues as all my other pages/links contact server and are
    redirected from there. In those cases it's really becoming a huge
    problem, For ex:

    From mainMenu - I click on "remove item" link and remove an item from
    DB. After doing that successfully I will be redirected from the
    server back to my MainMenu and this time the URL of my mainMenu page
    will be http://127..../removeItem.do?item=123
    When I click on some other link on mainMenu say "view profile" and
    hit "back button" to come back to my previous page - it is taking me
    to the http://127..../removeItem.do?item=123 url and this time it is
    really taking me to the removeItem page, instead of mainMenu.

    I don't know how I can make it behave like IE which usually redirect
    to such server-redirected urls and doesn't try to perform the action
    mentioned in the url.

    Any suggestions/ideas will be of great help.

    Thank You
    -WJ

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    202

    RE: back button problem - need hlp.

    Did you find an answer to your question yet?
    One thing that would probably help get your a quicker answer is to post something up on a real website somewhere that people can hit. That way, we can actually see what's going on versus what's supposed to be happening. It's difficult to provide an intelligent answer when the question is difficult to grasp in a few sentences.

    So...having said that...I am going to take a stab at answering your question.
    Use an explicit prev in your WML markup. And don't call it "Back". Label it something different (i.e. Previous) since Nokia phones have a permanent "back" button. In most Nokia phones, this will show up as an item under the Options softkey. The permanent back button will always pop the last item that was pushed onto the history stack.
    (You can thank our friends in the WAP forum for not putting implicit prev in WML. For reasons such as this WML didn't take off very well in the US.)

    You could also just provide a link on the page to go back to the calling WML. i.e. "Click 'here' to go back". With the word "here" wrapped in the <a href>. It's really a forward navigation though.

    Mike

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    13

    Hi Wenyancam

    I am having a problem with my WAP application which im sure you could solve after reading your posting. I would be very very grateful if you could help.

    Basically, my WAP application is similar to yours in terms of username and password login, however mine is more simple. I am storing users in a Access database, and i am using WML and ASP. I have got to the stage of where the system allows a valid member to log into the system. In your system you mention you have implemented a main menu, ie once the user has logged in they are directed to this card. I was wandering, what the code for this part was?? I have posted my current code below for your reference.

    LoginASP.wml -
    ----------------------------------------------------------
    <?xml version="1.0"?>
    <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
    "http://www.wapforum.org/DTD/wml_1.1.xml">

    <wml>

    <!-- card 1 -->
    <card id="username" title="Username" ontimer="#message">
    <timer name="nametime" value="50"/>
    <do type="accept" label="Go">
    <go href="#password"/>
    </do>
    <p>
    <anchor title="Go"><go href="#set"/>Settings</anchor><br/>
    Enter username:
    <input name="username" type="text" maxlength="5"/>
    </p>
    </card>

    <!-- card 2 -->
    <card id="password" title="Password">
    <do type="accept" label="Go">
    <go method="post" href="http://localhost/menu2.asp">
    <postfield name="username" value="$username"/>
    <postfield name="password" value="$password"/>
    </go>
    </do>
    <p>Enter password:
    <input name="password" type="password" maxlength="6"/>
    </p>
    </card>

    <!-- Card 3 -->
    <card id="message" title="Message">
    <do type="accept" label="Go">
    <go href="home.wml"/>
    </do>

    <do type="option" label="Settings">
    <go href="#set"/>
    </do>

    <p>Expired input time limit. Login again?</p>
    </card>

    <!-- Card 4 -->
    <card id="set" title="Settings">
    <do type="accept" label="Go">
    <go href="#username"/>
    </do>
    <p>Set input time:
    <input name="nametime" format="*N"/>
    </p>
    </card>

    </wml>
    ----------------------------------------------------------

    menu2.asp -
    ----------------------------------------------------------
    <%Response.ContentType = "text/vnd.wap.wml" %><?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="menu" title="Menu">
    <p>
    <%
    dim dbConn, sql, empl

    set dbConn = Server.CreateObject("ADODB.Connection")
    dbConn.open("dsn=company")

    sql = "SELECT * FROM tblEmpl WHERE username='"&Request.Form("username")&"' AND password='"&Request.Form("password")&"'"

    set empl = dbConn.Execute(sql)

    if empl.EOF then
    Response.Write "You have entered an invalid login."
    else
    Response.Write "Welcome, " & empl("fname")
    end if

    empl.Close
    dbConn.Close
    set empl = Nothing
    set dbConn = Nothing

    %>
    </p>
    </card>

    </wml>
    ----------------------------------------------------------

    If the question is not clear, i would be very grateful if you could email me so i can provide further clarification - boston465@aol.com.

    Best Regards.

Posting Permissions

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