473,549 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WML PHP Login pages

XP
I am having problems with the blow page. I have a login page where I
enter the userid and password. This then connects to this page. If I
enter the userid and password correctly, it prints successfully logged
into system. If I enter the wrong information all I get is an erro page
HTTP status 502 etc.

Can anyone help?

<?php

Header("Content-type: text/vnd.wap.wml");
Header("Cache-Control: no-cache, must-revalidate");
Header("Pragma: no-cache");
echo ("<?xml version='1.0'?> ");
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.or g/DTD/wml_1.1.xml">
<wml>
<card id="result" title="Test password login">
<p>
<?php
// connect to mysql database
$dab = mysql_pconnect( "localhost" , "root");
$db = mysql_select_db ("login");

$query = "SELECT user, pass FROM login WHERE user='$userid' AND
pass='$password '";

$result = @mysql_query($q uery);
if(!$result){
$err=mysql_erro r();
print$err;
exit();
}
if(mysql_affect ed_rows()==0){
print"no such login in the system";
exit();
}
else{
print "successful ly logged into system";
}
print "<b> output....</b> <br/>";
print "$password" ;

?>
</p>
</card>
</wml>

Reply

Bent Stigsen May 4, 4:17 pm show options
Newsgroups: comp.lang.php
From: Bent Stigsen <n...@thevoid.d k> - Find messages by this author
Date: Wed, 04 May 2005 17:17:34 +0200
Local: Wed,May 4 2005 4:17 pm
Subject: Re: WML PHP login page
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse

- Hide quoted text -
- Show quoted text -
XP wrote:
I am having problems with the blow page. I have a login page where I
enter the userid and password. This then connects to this page. If I
enter the userid and password correctly, it prints successfully logged into system. If I enter the wrong information all I get is an erro page HTTP status 502 etc. [snip] <wml>
<card id="result" title="Test password login"> [snip] if(mysql_affect ed_rows()==0){
print"no such login in the system";
exit(); [snip] </card>
</wml>


The xml will be malformed if you exit before closing nodes.

/Bent

Reply

XP May 4, 5:09 pm show options
Newsgroups: comp.lang.php
From: "XP" <auj...@dsl.pip ex.com> - Find messages by this author
Date: 4 May 2005 09:09:05 -0700
Local: Wed,May 4 2005 5:09 pm
Subject: Re: WML PHP login page
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Remove | Report Abuse

Thanks. That seems to work now.

How do I add things into the if or else. For example after printing
successfully logged into system, how do I make it go to specific page?
When I add to the else statement, I get an error. What format do I need
to enter here?

Jul 17 '05 #1
4 3423
XP wrote:
if(mysql_affect ed_rows()==0){
print"no such login in the system";
exit();
}


This and the previous exit cause the WML page to be invalid, because the
closing <p>, <card> and <wml> tags will be missing.

Try something like the following instead:

<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.or g/DTD/wml_1.1.xml">
<wml>
<card id="result" title="Test password login">
<p>
<?php
// connect to mysql database
....
$result = @mysql_query($q uery);
if (!$result) {
print mysql_error();
}
else if (mysql_affected _rows()==0) {
print "no such login in the system";
}
else {
print "successful ly logged into system";
print "<b> output....<b> <br>";
print "$password" ;
}
?>
</p>
</card>
</wml>
JW

Jul 17 '05 #2
Janwillem Borleffs wrote:
print "successful ly logged into system";
print "<b> output....<b> <br>";
print "$password" ;
}


Replace the following line:

print "<b> output....<b> <br>";

With:

print "<b> output....</b> <br />";
JW

Jul 17 '05 #3
XP

Janwillem Borleffs wrote:
Janwillem Borleffs wrote:
print "successful ly logged into system";
print "<b> output....<b> <br>";
print "$password" ;
}


Replace the following line:

print "<b> output....<b> <br>";

With:

print "<b> output....</b> <br />";
JW

Thanks for that. But, what I am trying to do is to redirect the user,
once they are logged in. I want to place either an automatic forward to
another page or to place a link to another page so that once the user
is logged on, they can move on to the next stage. If I use wml here,
obviously it does not work. Do I need to put a series of /'s around the
code?

Jul 17 '05 #4
XP wrote:
Thanks for that. But, what I am trying to do is to redirect the user,
once they are logged in. I want to place either an automatic forward
to another page or to place a link to another page so that once the
user is logged on, they can move on to the next stage. If I use wml
here, obviously it does not work. Do I need to put a series of /'s
around the code?


On the same page:

<?php
// connect to mysql database
....
$result = @mysql_query($q uery);
if (!$result) {
$message = mysql_error();
}
else if (mysql_affected _rows()==0) {
$message = "no such login in the system";
}
else {
header("Locatio n: newpage");
exit;
}
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.or g/DTD/wml_1.1.xml">
<wml>
<card id="result" title="Test password login">
<p>
<?php print $message ?>
</p>
</card>
</wml>
JW

Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2840
by: TheDD | last post by:
Hello every body, i have to do a news system wich use php/mysql. i need 3 accounts: * a 'reader' who doesn't need to log in to read the news * a 'writer' who can write news in a pending news table * a 'moderator' which validate a pending news, and make it a regular news, viewable from the site (by the 'reader')
2
2203
by: Rujuta Gandhi | last post by:
Hi All, I am facing a very crucial problem. Im developing a web application using .net studio 2005(beta). I want my Login.aspx page to be secured(https) for encrypted login information transfer. I modified web.config and properties of Login page from IIS server. And now when ever the execution is redirected to Login.aspx It is having...
0
1406
by: Tim T | last post by:
Hi, I have a web application that has a number of users who administer their own data... i have several pages that check to see if a valid userID session exists, and if not, send them to a Login.aspx page (where a userID session is generated upon successful login). my pages are user specific, so each page will load data specific to that user...
4
2810
by: nicholas | last post by:
Hi, Got an asp.net application and I use the "forms" authentication mode defined in the web.config file. Everything works fine. But now I would like to add a second, different login page for the users that go in a specific folder. How can I do this?
3
4042
by: E | last post by:
Hi, I'm creating a few pages on my site that you need to login to view. The login pages and the secure pages are .aspx . If I want links at the top of all pages on the site that says either "Login" or "Welcome Bob. Click here to logout", do I have to make all of my pages .aspx or is there a way to keep the unsecure pages HTML and somehow...
1
4980
by: Jakob Lithner | last post by:
When I started a new ASP project I was eager to use the login facilities offered in Framework 2.0/VS 2005. I wanted: - A custom principal that could hold my integer UserID from the database - An easy way to classify different pages as either Admin, Member or Public, where login is necessary for Admin and Member but not for Public. My idea...
6
3327
by: AppleBag | last post by:
I'm having the worst time trying to login to myspace through code. Can someone tell me how to do this? Please try it yourself before replying, only because I have asked this a couple of times in the past in other places, and while the help was much appreciated, it seemed everyone just wanted to 'theoretically' explain how to do it, but when I...
1
1260
by: PokerMan | last post by:
Hi I am trying to use the login control but there seems to be so much set up required and it seems to lock the entire site and require a login for every page. All i want is to use the functionality of this control and be able to set the pages that must require a successfull login to view. Also i use master pages which seem to not show...
3
4327
by: =?Utf-8?B?RHVrZSAoQU4yNDcp?= | last post by:
The majority of pages on our site need authentication (forms auth against the aspnetdb database). I created an '~/auth' folder with its own config file forcing authentication for any pages in the folder. The default.aspx sits in the root folder and just does a Response.Redirect to an ~/auth/home.aspx page. The config forces authentication,...
10
4797
by: DavidPr | last post by:
When I logout as one user and log in under a different user, it opens with the last user's information. User 1 - Unsername: Davey Jones User 2 - Unsername: David Smith I log out from Davey Jones, then login as David Smith the Welcome message below will show "Welcome Davey". And it will be Davey's information that is accessible - not David...
0
7524
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7451
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7960
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7475
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7812
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3483
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1944
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1061
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
766
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.