MySQL Forums
Forum List  »  Connector/Node.js

Re: Data Insert Using XML
Posted by: noxhanti piliso
Date: June 11, 2006 02:20PM

I know this is not the right forum but i can't get answers elsewhere. My problem is similar to the above except that it involves wml. I created the code below, but I get errors (unexpected end to wml source).Does anyone know what to do?

repdetails.wml

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">;

<wml>
<card id="card2" title="userdetails">

<p>
User Details:<br/>

Enter User ID<br/>
<input name="repid"/><br/>
Enter Name<br/>
<input name="name"/><br/>
Enter address<br/>
<input name="address"/><br/>

Enter Telephone Number<br/>
<input name="tel"/><br/>


<anchor>
<go method="get" href="insert.php">
<postfield name="customer_id" value="$(repid)"/>
<postfield name="name" value="$(name)"/>
<postfield name="address" value="$(address)"/>
<postfield name="tel" value="$(tel)"/>
</go>
Submit Data
</anchor>
</p>
</card>
</wml>

insert.php
<?php
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>

<wml>
<card id="card2" title="add">
<p>

<?php

//connect to database server
$connection = mysql_connect("localhost", "root", "password")
or die ("connection failed");

//Select the database
$db = mysql_select_db("db_wap", $connection)
or die ("failed to select database <br />\n");

//execute a query
$sql = mysql_query("INSERT INTO 'tbl_User' ('repid', 'name', 'address', 'tel') Values ('$_GET[repid]', '$_GET[name]', '$_GET[address]', '$_GET[tel]')") or die("Input failed");

if (!$sql) {
echo "Error cannot Insert record.!!!<BR>"; mysql_error;exit;
}else {
echo "record inserted";
}

//insert OK inform user

print "<b>Customer Database:</b> <br/>";

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

Options: ReplyQuote


Subject
Written By
Posted
January 04, 2006 12:36AM
Re: Data Insert Using XML
June 11, 2006 02:20PM
July 22, 2006 08:23PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.