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 September 7th, 2006, 09:28 PM
wackyflik wackyflik is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 218 wackyflik Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 3 Days 5 h 30 m 2 sec
Reputation Power: 0
How to retrieve value from setvar in the next deck?

i have this, login.php. i want to send the person's name to menu.php. how to do that?

PHP Code:
<?php
header
('Content-type: text/vnd.wap.wml');
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
echo 
"<?xml version=\"1.0\"?>";
echo 
"<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"" 
   
" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";

include(
'database.php');

if(empty(
$_POST['UID']) || empty($_POST['PWD'])){
?>
<wml>
    <card id = "invalid" title = "Invalid Login">
    <p>Invalid login.</p>
    <p>Click <anchor>here<prev /></anchor> to login back.</p>
    </card>
</wml>
<?php 
} else {
    
$uid $_POST['UID'];
    
$pwd $_POST['PWD'];
    echo 
'<wml>';
    echo 
'<card ';
    
$sql "SELECT pro_name FROM profile WHERE pro_uid = '$uid' AND pro_pwd = '$pwd'";
    
$query mysql_query($sql);
    
$row mysql_num_rows($query);
    if(
$row == 0){
        echo 
'id = "incorrect" title = "Incorrect Login">';
        echo 
'<p>Incorret username or password. Click <anchor>here<prev /></anchor></p>';
    }
    else{
        
$result mysql_fetch_array($query);
        echo 
'id = "success" title = "Successful Login">';
        echo 
'<p>';
        echo 
'Welcome, ' $result['pro_name'] . '.';
        echo 
'</p>';
        echo 
'<setvar name = "pro_name" value = "'$result['pro_name'] .'" />';
        echo 
'<p>';
        echo 
'1. <anchor>';
        echo 
'<go method = "post" href = "menu.php">';
        echo 
'<postfield name = "NAME" value = "$(pro_name)" />';
        echo 
'</go>';
        echo 
'Menu</anchor>';
        echo 
'</p>';
    }
    echo 
'</card>';
    echo 
'</wml>';
}
?>

Last edited by wackyflik : September 7th, 2006 at 09:50 PM.

Reply With Quote
  #2  
Old September 8th, 2006, 01:32 AM
jabba_29's Avatar
jabba_29 jabba_29 is offline
Back in HEL
Dev Shed God 8th Plane (8500 - 8999 posts)
 
Join Date: Feb 2002
Location: Finland
Posts: 8,766 jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th 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: 3 Months 3 Weeks 6 Days 5 h 28 m 19 sec
Reputation Power: 1632
Send a message via ICQ to jabba_29 Send a message via AIM to jabba_29 Send a message via MSN to jabba_29 Send a message via Yahoo to jabba_29 Send a message via Google Talk to jabba_29 Send a message via Skype to jabba_29
Facebook
Quote:
Originally Posted by w3schools
The <setvar> tag sets a variable to a specified value in a <go>, <prev>, or <refresh> task.
So, I would try something like:
php Code:
Original - php Code
  1. <?php
  2. // stuff
  3. echo '<p>Welcome, ' . $result['pro_name'] . '.
  4.     <anchor>
  5.     <go href="menu.php">
  6.     <setvar name="NAME" value="'. $result['pro_name'] .'"/>
  7.     </go>
  8.    </anchor>
  9.       </p>';
HTH
__________________
Cheers,

Jamie


# skiFFie | Home of the 'accessibility module' for Drupal
# Jamie Burns [me] Accessibility Module [drupal]
# 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
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreMobile Programming > How to retrieve value from setvar in the next deck?


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


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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway