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 February 6th, 2005, 01:30 PM
varunkrish varunkrish is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 13 varunkrish User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 2 sec
Reputation Power: 0
WAP login script in php

i currently have a mobile site and a wap version of it too

i want to have a login page on the wap site

the user database is based on php nuke
the password is md5 hashed

how do i get abt verifying username n password and logging him in??

what abt sessions in php?

please help

Reply With Quote
  #2  
Old February 7th, 2005, 03:39 AM
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,061 jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th 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 9 h 48 m 17 sec
Reputation Power: 2015
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
Simple example. First page is a form. You will need to change field names accordingly.
Second processes the info.
If successful, it creates another form and this field is validated in the admin.php page.
You can of course use $_SESSION's.
Hope it gives you an idea at least.

PHP Code:
// login.php
<?php
# Header Info
header('Content-Type: text/vnd.wap.wml'true);
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
# Version Type
print "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";
# Import config file
include "/home/jamieb/private/conf.php";
# Connect to database
mysql_connect($dbhost$dbuser$dbpass);
mysql_select_db($dbname);
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">

<wml>

<!-- THIS IS THE LOGIN CARD -->
<card id="login" title="Login">
<p>
<do type="accept" label="Login">
<go href="process.php" method="post">
<postfield name="userName" value="$userName" />
<postfield name="password" value="$password" />
</go>
</do>
</p>

<p>
User Name: <input title="userName" name="userName" /> <br />
Password : <input title="password" name="password" type="password" /> <br />
</p>
</card>

</wml> 

PHP Code:
// process.php
<?php
# Header Info
header('Content-Type: text/vnd.wap.wml'true);
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
# Version Type
print "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";
# Import config file
include "/home/jamieb/private/conf.php";
# Connect to database
mysql_connect($dbhost$dbuser$dbpass);
mysql_select_db($dbname);
# Verify the user
$sql mysql_query("SELECT userName,nickName FROM table WHERE userName = '".strtolower($_POST['userName'])."' AND password = '".md5($_POST['password'])."'");
$row mysql_num_rows($sql);
$login mysql_fetch_array($sql);
$user md5($login['userName']);
$nick $login['nickName'];
if (
$row == 0):
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="failed" title="Login Failed">
<p>
Sorry, username or password incorrect!
</p>

<p>
<anchor>Home
<go href="index.php#menu" />
</anchor>
<do type="prev" label="Back"><prev/></do></p>
</card>
</wml>

<?php
exit;
else:
?>

<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="success" title="Login Success">
<p>
<do type="accept" label="Admin">
<go href="admin.php" method="post">
<postfield name="session" value="<?php echo "$user"?>" />
</go>
</do>
</p>
<p>Welcome <?php echo "$nick"?>, please enter the admin area.</p>
</card>
</wml>

<?php
endif;
?> 
__________________
Cheers,

Jamie

# mdb4u | mobile movie database | Please help to test and promote
# 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
  #3  
Old February 7th, 2005, 06:09 AM
varunkrish varunkrish is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 13 varunkrish User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 2 sec
Reputation Power: 0
re:wap php login

thanks a lot for the quick response..

Do u do wap coding for charges??

I get many offers..

U want to join me?

Reply With Quote
  #4  
Old February 7th, 2005, 06:33 AM
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,061 jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 15th 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 9 h 48 m 17 sec
Reputation Power: 2015
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
Maybe - PM me more

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreMobile Programming > WAP login script in php


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 5 hosted by Hostway
Stay green...Green IT