im using php to access data in mysql database but i would like to store form data into my database using php and how do i select username and password using php in a form created kendoui...thanks in advance.
<?php
$link = mysql_pconnect("localhost", "root", "") or die("Unable To Connect To Database Server");
mysql_select_db("db") or die("Unable To Connect To ebusticket");
$request_vars = Array();
parse_str(file_get_contents('php://input'), $request_vars);
$arr = array();
$fname = $request_vars["fname"];
$lname = $request_vars["lname"];
$rs = mysql_query("insert into table (Pass_Surname, Pass_Fname) values ('" .$lname. "' , '" .$fname. "'");
if ($rs) {
echo json_encode($rs);
}
else {
header("HTTP/1.1 500 Internal Server Error");
echo "Insert Failed";
}
// add the header line to specify that the content type is JSON
header("Content-type: application/json");
?>
<?php
$link = mysql_pconnect("localhost", "root", "") or die("Unable To Connect To Database Server");
mysql_select_db("db") or die("Unable To Connect To ebusticket");
$request_vars = Array();
parse_str(file_get_contents('php://input'), $request_vars);
$arr = array();
$fname = $request_vars["fname"];
$lname = $request_vars["lname"];
$rs = mysql_query("insert into table (Pass_Surname, Pass_Fname) values ('" .$lname. "' , '" .$fname. "'");
if ($rs) {
echo json_encode($rs);
}
else {
header("HTTP/1.1 500 Internal Server Error");
echo "Insert Failed";
}
// add the header line to specify that the content type is JSON
header("Content-type: application/json");
?>