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 = @($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 ?