Mobile Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreMobile Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 23rd, 2009, 05:58 AM
paperboy paperboy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 2 paperboy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 48 m 2 sec
Reputation Power: 0
Post WML and PHP with MySQL

Hi,
I encountered this problem with variable passing. When I take in a variable from input card and compare that variable with database variable it does not match however when echoed it shows that both are the same.
the if condition if($n==$an) never becomes true!
How to over come this problem it'll be greate to get your ideas. I am very new to WML. Pls help thank you guys

Code:
<?php 
header("Content-type: text/vnd.wap.wml"); 
echo "<?xml version=\"1.0\"?>"; 
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"" 
. " \"(URL address blocked: See forum rules)\">"; 

?>
<wml>

<card id="card1" title="Input">
    <do type="accept" label="Login">
      <go href="#card2"/>
    </do>
    <p>
    Name:<input name="name" size="10"/><br/>
    Pass:<input name="pass" size="10"/><br/>
    </p>
  </card>
  <card id="card2" title="Welcome">
    <p>
    <?php
    print "Welcome: $(name)<br/>";
    print "Your pass is: $(pass)<br/>";
    $an = "$(name)";
    $ab = "$(pass)";
    echo "$an";
    include("connect.php");
    $query = "select username from admin"; 
    $result = @mysql_query($query);
    while ($row = mysql_fetch_array($result)) :
    $n = $row['username'];
    $p = $row['username'];
    echo "$n";
    if($n==$an){
    print "login successful<br/>";
    }
    endwhile;
    print "Welcome: $an $n<br/>";
    $the_date = date("M d Y"); 
    print $the_date;
    
    ?>
    </p>
    
  </card>

</wml>

Reply With Quote
  #2  
Old April 26th, 2009, 04:06 PM
jabba_29's Avatar
jabba_29 jabba_29 is offline
Back in HEL
Dev Shed God 9th Plane (9000 - 9499 posts)
 
Join Date: Feb 2002
Location: Finland
Posts: 9,074 jabba_29 User rank is General 16th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 16th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 16th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 16th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 16th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 16th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 16th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 16th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 16th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 16th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 16th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 16th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 16th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 16th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 16th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 16th Grade (Above 100000 Reputation Level)  Folding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner Folder
Time spent in forums: 4 Months 3 Days 21 h 8 m 2 sec
Reputation Power: 2030
Send a message via AIM to jabba_29 Send a message via Google Talk to jabba_29 Send a message via Skype to jabba_29
Facebook
Hi, I think the issue is that you are mixing PHP and WML variables.

When I did WML pages using PHP, I used primarily PHP variables as they seemed to be slightly more reliable.

Try print_r($_REQUEST) on your results page and see what you get.
__________________
Cheers,

Jamie

# mdb4u | mobile movie database | Currently being revamped
# skiFFie | Jamie Burns [me]
# guidelines | search | wap resources | not getting help | fold to cure

__________________

Let the might of your compassion arise to bring a quick end
to the flowing stream of the blood and tears .....
Please hear my anguished words of truth.



__________________

Reply With Quote
  #3  
Old April 26th, 2009, 11:22 PM
paperboy paperboy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 2 paperboy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 48 m 2 sec
Reputation Power: 0
Hi,
Thanks for your reply. Yes its due to variable difference I was able to follow some instructions from a different threat and was able to get arround the problem.

When I pass the variable to a different page and use GET the variable is usable.

Code:
<go href="auth.php?n=$(name)&p=$(pass)"/>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreMobile Programming > WML and PHP with MySQL


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
Stay green...Green IT