|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
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> |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > WAP Programming > Help with some code |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|