Hi all,
My question is regarding php search. I am wondering how do I begin coding a php search page whose sole function is to search only one url and display (echo) the contents within the DIV ID of the searched url. In essence I want to be able to display the content of this div id as a summary of the searched url. Is this possible? how do I begin with this? Thanks
[RESOLVED] Search only content within Div ID and display
client sends a get or post request to your server.
Get the contents of the file you want to search. Easiest is probably file_get_contents(). Then either regexp (preg_match()) or the DOM classes (recommended) to get the data.
echo whatever you pulled out from the div.
Thanks, I will start writing a code for this the way you have suggested.
If there are any more ideas to approach this please let me know
I do this with a myspace userinfo display, check out my page, you can get the source files, its a good start and self explainitory
lemme know if that helps, be sure to get the source files, i think the syntax highlighter im using screws up code.
ooohhhh, this looks beautiful. Awesome.
I will try this, this is amazing feedback.
This code is brilliant, I am currently trying to modify it to skip a few lines/and or grab only a few within the div class, to make a customizable presentation of data
its tricky but once you get the right setup it works wonders.... untill they change thier site. lol
well, you are right about the changing of website, but I was thinking of reading the website url through a variable as well, which is stored in the mysql database specific to that domain, if a change is made only thing that will be needing update will be the database url value and the div class id in the database.
The ideas was a proof of concept, you have given that. Now the application needs to be customized more to display data and made more robust through dynamic variable assignment specific to domains