Web Analytics Made Easy -
StatCounter Please help with own Search Function - CodingForum


No announcement yet.

Please help with own Search Function

  • Filter
  • Time
  • Show
Clear All
new posts

  • Please help with own Search Function

    I have many urls. For example:

    I have also a main page that has a search box where you can type for example "welcome" and then hit Search button. Then it should display ALL sentences that contains word "welcome" in those urls above. How would you do that?

    I know how to fetch info from urls with fsockopen and then use preg_match to see if there is text but can you write me a regular expression?

    "hello and welcome to my world! It's beautiful day today!!"

    If I search now for welcome it should return: "hello and welcome to my world!". But if I search for a word "it", it will return me: "It's beautiful day today!!" - so the sentences that has the word.

    Possible? Thanks for any help! Really need this!
    PHP 5 & MySQL 5 (Y)

  • #2
    And if someone can answer me why this doesn't work?

    $fp = fsockopen("psychclassics.yorku.ca/Abbott",80,$errno,$errstr,0.5);

    It does not create sock connection
    PHP 5 & MySQL 5 (Y)


    • #3
      And what are the values of $errno and $errstr after the function call?


      • #4
        Okay I got it now. But can someone help me out with this problem:


        It should preg_match the http://www.sdg.com/drgfd/fdfg.html; part of the text, it always starts with http:// and ends with ;, help?
        PHP 5 & MySQL 5 (Y)


        • #5
          PHP Code:


          • #6

            Btw, how do you check a start? if ?; is the end, how to check start?
            PHP 5 & MySQL 5 (Y)