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:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old June 21st, 2004, 08:53 AM
mu5icman mu5icman is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 1 mu5icman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Help with some code

I have code which contacts a mysql database to retrieve a username and password to verify members. The code isn't working properly and i don't know why. could someone help me:

<?php

// output correct HTTP content type
header( 'Content-type: text/vnd.wap.wml' );

if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
// load vbulletin stuff
require_once( '../vbulletin/includes/config.php3' );

// validate user
mysql_connect( $servername, $dbusername, $dbpassword );
mysql_select_db( $dbname );

$sql = <<<eos
select user_id from wap_users where username='$_POST[username]' and password='$_POST[password]' LIMIT 1
eos;

$result = mysql_query( $sql );

if ( mysql_num_rows( $result ) ) {
$row = mysql_fetch_row( $result );

$sql = <<<eos
UPDATE wap_users SET login_count=login_count+1,last_login=NOW()
eos;

mysql_query( $sql );

session_name( 'wap' );
session_start();
$_SESSION['wap'] = true;

header( "Location: http://$_SERVER[HTTP_HOST]" . dirname( $_SERVER['PHP_SELF'] ) . '/wap.php' );
exit;
}
}

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

<wml>
<head>
<META name="generator" CONTENT="BBEdit 6.5" />
</head>
<card id="servers" title="machineguard login">
<do label="Login" TYPE="accept">
<go HREF="#card2" METHOD="post">
<postfield name="username" VALUE="$(username)" />
<postfield name="password" VALUE="$(password)" />
</go>
</do>

Username:<BR /><INPUT TYPE="text" name="username" /><BR />
Password:<BR /><INPUT TYPE="password" name="password" /><BR />

</card>

</wml>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > Help with some code


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