I am new to PHP. I want to implement search using keypress i.e you enter the ID in a textfield and press the Enter key, which will call a certain function or php file which will do the search and load required data. my problem is how to make the keypress event call that PHP file by giving it url.

Why not just use a HTML form, with the PHP file path set as the action. Generally, hitting enter in a text field will submit the form. If not, use JavaScript to force form submission when the enter key is pressed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.