Jump to content


This topic is now archived and is closed to further replies.


Problem with indexing script

Recommended Posts

Hiya everyone,

I need some serius help.

i have a php script which indexes my website. The problem is that it indexes EVERYTHING including unwanted things like my html menu. This means that when i search, it is displayed.... Have a look at [a href=\"http://hairandbeautypages.com/find/?query=hebe&type=advanced&searchType=2\" target=\"_blank\"]http://hairandbeautypages.com/find/?query=...ed&searchType=2[/a] (the first result).

The file which controls the indexing is the class.index php file. In it, i have this:

[code]// Has this page got any script tags?
                    while(preg_match('%<script[^>]*>.*?</script>%is', $pageData, $ignore_matches)) {
                        $pageData = str_replace($ignore_matches[0], '', $pageData);

                    [b]// Only grab the contents of the page body and then
                    // strip out any script tags
                    eregi("(<body[^>]*>.*</body>)", $pageData, $bodyArray); [/b]

                    if (sizeof($bodyArray) > 0) {
                        $strippedPageData = strip_tags($bodyArray[1]);
                    } else {
                        $strippedPageData = '';


The bolded is what i think i need to change. I tried adding <spider></spider> tags to my page, and changed body to spider in the script, but it still dosent work.

Any help will be gratley appreciated! Any ides on how i can get the script to index the contant between the <spider></spider> tags only?


Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.