PHP Search on web pages

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gnawz
    New Member
    • Nov 2006
    • 64

    PHP Search on web pages

    Hi

    Anyone knows PHP or HTML or can provide code on searching content in webpages that are not database-driven and display results?
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    This site is for programmers helping programmers. This is not a site that delivers ready-made code!

    So: write your own code for this function and, when running into problems or having questions about it, come back here and we will try to help.

    Ronald

    Comment

    • gnawz
      New Member
      • Nov 2006
      • 64

      #3
      Originally posted by ronverdonk
      This site is for programmers helping programmers. This is not a site that delivers ready-made code!

      So: write your own code for this function and, when running into problems or having questions about it, come back here and we will try to help.

      Ronald
      Hi

      I do not have any code for searching web pages. I only have code that performs searches in a MySQL database.

      Please hlep.

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        But you are supposed to write the code yourself. Copying scripts from someone else does not help you in any way. When you are looking for someone to write your code you better place an ad in the Jobs section of this site or look for a professional programmer to do the job for you.

        Ronald

        Comment

        • gnawz
          New Member
          • Nov 2006
          • 64

          #5
          Originally posted by ronverdonk
          But you are supposed to write the code yourself. Copying scripts from someone else does not help you in any way. When you are looking for someone to write your code you better place an ad in the Jobs section of this site or look for a professional programmer to do the job for you.

          Ronald
          I need a search that SEARCHES INFORMATION ON THE SERVER (WEB PAGES). not information held in the database
          Below is my search code:[php]<?
          if ($searching =="yes")
          {
          echo "<h2>Result s</h2><p>";

          //If search is empty
          if ($find == "")
          {
          echo "<p>Please enter your search criteria";
          exit;
          }
          //Connecting to the database
          $dbConn = mysql_connect ($dbHost, $dbUser, $dbPass) or die ('MySQL connect failed. ' . mysql_error());
          mysql_select_db ($dbName) or die('Cannot select database. ' . mysql_error());
          // Filtering
          $find = strtoupper($fin d);
          $find = strip_tags($fin d);
          $find = trim ($find);
          $search = mysql_query("SE LECT * FROM users WHERE upper($field) LIKE'%$find%'") ;
          //Results
          while($result = mysql_fetch_arr ay( $search ))
          {
          echo $result['fname'];
          echo " ";
          }
          //
          $Notfound=mysql _num_rows($sear ch);
          if ($Notfound == 0)
          {
          echo "No record matches yur search<br><br>" ;
          }
          echo "<b>You searched For:</b> " .$find;
          }
          ?>[/php]
          Last edited by ronverdonk; May 2 '08, 02:24 PM. Reason: code tags

          Comment

          • ronverdonk
            Recognized Expert Specialist
            • Jul 2006
            • 4259

            #6
            WARNING:
            Please enclose your posted code in [code] tags (See How to Ask a Question).

            This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

            Please use [code] tags in future.

            MODERATOR

            Comment

            • ronverdonk
              Recognized Expert Specialist
              • Jul 2006
              • 4259

              #7
              .... I need a search that SEARCHES INFORMATION ON THE SERVER (WEB PAGES). not information held in the database ....
              I see your question and the answer is still the same. Adapt your code to search for webpage items and we will help you when you run into problems. But we do not write your solution for you.

              But you'll have to start coding yourself.

              Ronald

              Comment

              • gnawz
                New Member
                • Nov 2006
                • 64

                #8
                Originally posted by ronverdonk
                WARNING:
                Please enclose your posted code in [code] tags (See How to Ask a Question).

                This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

                Please use [code] tags in future.

                MODERATOR
                I have no idea how to search in webpages without involving the database and I do not want to use the free google search. In life, there is something we all do not know and need help on how to go about it. I always get help from this forum and I thought proponents of open source programming make it easier for the languages to grow.
                I do not want anyone to write code for me. I thought I would get hints on how to go about it.

                It seems I am not going to be helped this time round.

                Comment

                • suneelk
                  New Member
                  • Jan 2008
                  • 2

                  #9
                  You can try with google search API http://www.googlesearc hbox.info/

                  Comment

                  • gnawz
                    New Member
                    • Nov 2006
                    • 64

                    #10
                    Originally posted by suneelk
                    You can try with google search API http://www.googlesearc hbox.info/
                    Thanks a lot but I do not want to use the free searches available.
                    I want to have my own search.

                    Comment

                    • TheServant
                      Recognized Expert Top Contributor
                      • Feb 2008
                      • 1168

                      #11
                      Originally posted by gnawz
                      Thanks a lot but I do not want to use the free searches available.
                      I want to have my own search.
                      What about seeing if you can (and are allowed to) alter their code to customize it. Without using databases you will have a hard time. This is no small task, and you will need to do 90% of the work, and we will help with the 10% that you can't do.

                      Comment

                      Working...