Hi,
Currently I am building a html page that has some fields to search items into database.
For the moment I am using 2 files index.html and search.php, in the page index.html I can input the word that I want
to search in the database and I send the inputs to the search.php file that it gives me the results in a table...
But here its the problem! This is a ugly way to do this.

Could anyone help me with an example how to make a seach page(.html) that interacts with a .php file, but it shows
the results on its page.

Recommended Answers

All 7 Replies

You would like to show the results on the same HTML page? Without any server side scripting on that HTML page, you can use JavaScript/Ajax to get results back from the web server.

Here are the files that I use. Could you modify them to work the way that I want?

PHP is not my strength. I have more expereince with asp.net. We'll need someone else to assist you with PHP guidance.

Thx man, however in my opinion this is a child stuff, but I am a begginer in web programming so I don't understand very well this things...

you are correct in your assumption. What you are asking is very basic.

The concept as I understand what you are asking is that you want to provide search capability from index.html and provide the results on the same page.

You can do this via Ajax.

Here is an example pretty close to your scenarion but is shown with a asp page. Instead of asp, your back-end page is the search.php page.

http://w3schools.com/ajax/ajax_database.asp

Good to hear!

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.