WAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreWAP 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:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old May 4th, 2004, 09:51 AM
superman's Avatar
superman superman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 88 superman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
cookies, sessions?

i use php and work with wml.
any solution that can pass the value to every page after login?
for example, when i login with ABC, then the ABC will display in every page like "Welcome ABC"
as i know WML can't work with cookies, can it work with sessions?
or any other solution?
or something like $HTTP_GET_VARS ???

Reply With Quote
  #2  
Old May 5th, 2004, 02:04 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,667 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 4 Days 5 h 1 m 49 sec
Reputation Power: 1618
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
You can use $_GET if you want. It depends on how you write your wml. Personally I cheat and echo PHP vars in WML, so I suppose sessions would work OK too, though I have never tried it(yet).
When I upgrade my football teams WAP site, I will probably use sessions. I have one update page currently that is only accessable if $_POST vars are present. This is a bit of a drag really, as to go to that page again, I link through a form to submit user details again.
All the other pages on the site are generated dependant on $_GET vars.
__________________
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

# Any form of employment is strictly prohibited ......


__________________

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 May 5th, 2004, 04:29 AM
superman's Avatar
superman superman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 88 superman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
can you show me some example?
i don't know this $_POST function, maybe this is the way that can help me
thank you....

Reply With Quote
  #4  
Old May 7th, 2004, 09:04 AM
superman's Avatar
superman superman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 88 superman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Code:
login.php

<?php 
header("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="card1" title="Nokia" newcontext="true"> 
    <p align="center"><b>Login</b><br/><br/></p>
	<p>
      Username: 
      <input name="username" size="10" />
      <br/>
      Password: 
<input type="password" name="password" size="10" maxlength="20"/><br />
      <anchor>
        Submit
        <go href="verify.php" method="post">
          <postfield name="username" value="$(username)"/>
          <postfield name="password" value="$(password)"/>
        </go>
      </anchor>
    </p>
  </card> 
</wml> 

----------------------------

verify.php

<?php 

session_start();  

header("Content-type: text/vnd.wap.wml"); 

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

echo "<wml>"; 
echo "<card id=\"card1\" title=\"Nokia\">";      
echo "<p>";
        if ($username==NULL && $password==NULL)
        {
            echo"Please Try Again!!!<br/>";
            echo"NO Username & Password<br/>";                       
            echo "Click <a href=\"login.php\">here</a> to try again !!<br/>";
            }
        else
        {        
            $Connect = mysql_connect("localhost","root","");
            mysql_select_db("wap");
            $check == 0;
            $result=mysql_query("select * from account");
            $number_of_rows = mysql_num_rows($result);
            $i=0;
            $check=0;
            while ($number_of_rows != 0)
            {
               $row = mysql_fetch_row($result);
               $number_of_rows--;
               if ($username==$row[0] && $password==$row[1]) 
  { 
     session_register('username'); 
     session_register('password'); 
     $_SESSION['username'] = $row[0]; 
     $_SESSION['password'] = $row[1]; 
      
     echo"Congratulations !!<br/>"; 
     echo "Hello!! <b>" . $_SESSION['username'] . "</b><br/>"; 
     echo"You had access Nokia website<br/>"; 
     echo "Click <a href=\"welcome.php\">here</a> to CONTINUE !!<br/>"; 
     $check=1; 
     break; 
} 
               }               
               if ($check == 0)
                {
                    echo"Please Try Again!!!<br/>";
                    echo"Wrong Username OR Password<br/>";                       
                    echo "Click <a href=\"login.php\">here</a> to try again !!";
                }
            }
echo "</p>"; 
echo "</card>"; 
echo "</wml>"; 
?>    



now it shows this error message:
Cannot load http://localhost/verify.php (HTTP Error 500 Server Error)

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > cookies, sessions?


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 3 hosted by Hostway