This one's for all you people who have tried a bit of WAP programming. I'm trying to create a login script that allows registered users to log in and displays a page with hyperlinks to other cards within the deck. The card I'm using to test this is the viewroutes card and the problem is that when I select that hyperlink, it takes me to the card which displays the wrong username message.
#!/usr/local/bin/perl -w $ENV{ORACLE_HOME} = '/opt/ORACLErdbms/V8.0.6.0'; use DBI; use CGI; $query = new CGI; $username = $query->param('username'); $password = $query->param('password'); $dbh = DBI->connect('DBI:Oracle:eimora','cs72dc','cs72dc') || die "Cannot connect: $DBI::errstr"; $verify = "SELECT user_name,user_pass FROM users WHERE user_name = \'$ +username\'"; $mine = $dbh->prepare($verify) || die "Cannot prepare statement: DBI::errstr"; $mine->execute || die "Cannot execute statement: DBI::errstr"; ($test_username,$test_password) = $mine->fetchrow_array(); $mine->finish; if (($test_username eq $username) && ($test_username ne $null)) { if (($test_password eq $password) && ($test_password ne $null)) { $statement = "SELECT route FROM history WHERE username=\'$user +name\'"; $mine = $dbh->prepare($statement) || die "Cannot prepare statement: DBI::errstr"; $mine->execute || die "Cannot execute statement: DBI::errstr"; $route = $mine->fetchrow_array(); $mine->finish; print<<"EOF"; Content-type: 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="MRP"> <p>Welcome $username </p> <p> <a href="#viewroute"> view routes </a> </p> </card> <card id="viewroute" title="MRP"> <p>Saved Routes </p> <p> <a href="$route"> $route </a> </p> </card> </wml> EOF } else { print<<"EOF"; Content-type: 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="WrongPassword" title="MRP"> <p>Wrong Password </p> <p align="left"> <a href="index.wml"> Try again </a> </p> </card> </wml> EOF } } else { print <<"EOF"; Content-type: 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="WrongUsername" title="MRP"> <p>Wrong Username </p> <p align="left"> <a href="index.wml"> Try again </a> </p> </card> </wml> EOF } $dbh->disconnect;
Pleeease help me!

In reply to Fiddling with WAP by cobra

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.