使用Javascript获取getElement,然后使用PHP查询数据库

I want to select an element using javascript and then want to query the database to search for that element.

Eg - The element that I want to select is a string called "Crate". Now I want to select crate, pass it onto a PHP variable and do a search the db for crate.

How do i do that?

thank you

Somehting like -

window.href="smaple.com/profile.php?username='crate';

and then use crate in profile.php with get function

I think the best thing for you to do is to read this AJAX, PHP tutorial.