Jump to content

Problem with indexing script


mitov

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);
                    }
                    unset($ignore_matches);

                    [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 = '';
                    }

                    unset($bodyArray);[/code]

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?

THANK YOU VERY MUCH FOR ALL YOUR HELP!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.