working with forma data using php

2 posts, 0 answers
  1. Benedict
    Benedict avatar
    6 posts
    Member since:
    Jul 2013

    Posted 28 Jul 2013 Link to this post

    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");
    ?>
  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 31 Jul 2013 Link to this post

    Hello,

    Question is not related to the KendoUI framework itself, but to PHP. Consider asking your question on the appropriate forums.

    Kind Regards,
    Petur Subev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top