dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: To insert php code in js

  1. #1
    Join Date
    Apr 2012
    Posts
    1

    To insert php code in js

    Hello,

    I am designing a web page and i need to write a function for the 'onchange' event of textfield. And I need to connect to database for the purpose.How can I insert the php code for db connection inside javascript??


    Thank you

  2. #2
    Join Date
    Mar 2012
    Posts
    202
    Quote Originally Posted by webdevlpr View Post
    Hello,

    I am designing a web page and i need to write a function for the 'onchange' event of textfield. And I need to connect to database for the purpose.How can I insert the php code for db connection inside javascript??


    Thank you
    Write a PHP file to handle the specific inputs and outputs you need from your database (assuming it works like, or is an SQL database), and let it manage the security behind it. Then connect to that PHP page using AJAX with JavaScript to communicate with the page to send/recieve information to/from the database.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles