Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Explained error but i still can't understand HELP
Old 05-08-2005, 02:17 PM Explained error but i still can't understand HELP
Junior Talker

Posts: 1
Trades: 0
I found this script on the internet. If i enter correct information then it is OK, but if I enter not correct then i get error: XML parsing failed: no element found (Line: 6, Character: 27)

<?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.org/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($query);
if(!$result){
$err=mysql_error();
print$err;
exit();
}
if(mysql_affected_rows()==0){
print"no such login in the system";
exit();
}
else{
print "successfully logged into system";
}
print "<b> output....</b> <br/>";
print "$password";

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

Someone WRITE explanation but i can't get it.

[snip]
> <wml>
> <card id="result" title="Test password login">
[snip]
> if(mysql_affected_rows()==0){
> print"no such login in the system";
> exit();
[snip]
> </card>
> </wml>

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

Can somebody write where's error ?
Gusts is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-16-2005, 07:45 AM
Novice Talker

Posts: 12
Trades: 0
Quote:
Originally Posted by Gusts
.........
[snip]
> <wml>
> <card id="result" title="Test password login">
[snip]
> if(mysql_affected_rows()==0){
> print"no such login in the system";
> exit();
[snip]
> </card>
> </wml>

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

here there's an "exit" before the close tag.
Try cutting the "exit".


Leonardos
__________________

Please login or register to view this content. Registration is FREE
Quick setup and full support.
Organizing faqs, managing visitors questions, jwHelp is the customer support software for your website.
leonardos is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Explained error but i still can't understand HELP
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.41719 seconds with 12 queries