Replace words on a php page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Antonio878
    Master Sergeant

    • Sep 2007
    • 68

    Replace words on a php page

    Can someone help me, i want a code that will automatically change words on the page like for example if i have kewl i want to be able 2 change all the words kewl to fool. I want to do something like that and it will replace on the kewls on the page and replace them as fool.

    So can someone help, Thank You
    Check out:
    Great Windmill (A Place Where You Can Have Fun!)

    You can do so much on the website, check it out!
  • Karen Mac
    General

    • Apr 2006
    • 8332

    #2
    Re: Replace words on a php page

    I have a program that does that.. but not a CODE. Not sure what purpose you want that done for.. but if you want something that changes each time its viewed try looking for "print praise" or a java script

    Karen

    VodaHost

    Your Website People!
    1-302-283-3777 North America / International
    02036089024 / United Kingdom
    291916438 / Australia

    ------------------------

    Top 3 Best Sellers

    Web Hosting - Unlimited disk space & bandwidth.

    Reseller Hosting - Start your own web hosting business.

    Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)


    Comment

    • Andy128
      Major General

      • Dec 2005
      • 2317

      #3
      Re: Replace words on a php page

      Antonio- do you have an example? A little more explaination might help.

      Andy
      PHP- is a blast!

      Comment

      • Antonio878
        Master Sergeant

        • Sep 2007
        • 68

        #4
        Re: Replace words on a php page

        Originally posted by Andy128 View Post
        Antonio- do you have an example? A little more explaination might help.

        Andy
        Ok here is 1, u know emotions on sites and when they put :) then it automatically changes to the smile face emotion when the post is made on the site.
        Check out:
        Great Windmill (A Place Where You Can Have Fun!)

        You can do so much on the website, check it out!

        Comment

        • Karen Mac
          General

          • Apr 2006
          • 8332

          #5
          Re: Replace words on a php page



          Karen

          VodaHost

          Your Website People!
          1-302-283-3777 North America / International
          02036089024 / United Kingdom
          291916438 / Australia

          ------------------------

          Top 3 Best Sellers

          Web Hosting - Unlimited disk space & bandwidth.

          Reseller Hosting - Start your own web hosting business.

          Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)


          Comment

          • Antonio878
            Master Sergeant

            • Sep 2007
            • 68

            #6
            Re: Replace words on a php page

            Originally posted by Karen Mac View Post
            Thats only xanga chat rooms and thats it u can't use it on a webpage itself only xanga
            Check out:
            Great Windmill (A Place Where You Can Have Fun!)

            You can do so much on the website, check it out!

            Comment

            • Karen Mac
              General

              • Apr 2006
              • 8332

              #7
              Re: Replace words on a php page

              So Google for another one. What do you want for free? Im sure they are out there.

              Karen

              VodaHost

              Your Website People!
              1-302-283-3777 North America / International
              02036089024 / United Kingdom
              291916438 / Australia

              ------------------------

              Top 3 Best Sellers

              Web Hosting - Unlimited disk space & bandwidth.

              Reseller Hosting - Start your own web hosting business.

              Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)


              Comment

              • navaldesign
                General & Forum Moderator

                • Oct 2005
                • 12080

                #8
                Re: Replace words on a php page

                You need to read the page code and then replace the original words.

                Usually you work like this:

                <?
                $url = "http://www.yourdomain.com/originalpage.html"; // The original page
                $string = file_get_contents($url);
                $pattern = " kewl ";
                $replacement = " fool ";
                $string = str_replace($pattern, $replacement, $string);
                // At this point ALL occurences of the word "kewl" are replaced
                echo $string; // This will output the new page to the browser.
                ?>
                Navaldesign
                Logger Lite: Low Cost, Customizable, multifeatured Login script
                Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                Comment

                • marsus
                  Private

                  • Jun 2009
                  • 2

                  #9
                  Re: Replace words on a php page

                  Originally posted by navaldesign View Post
                  You need to read the page code and then replace the original words.

                  Usually you work like this:

                  <?
                  $url = "http://www.yourdomain.com/originalpage.html"; // The original page
                  $string = file_get_contents($url);
                  $pattern = " kewl ";
                  $replacement = " fool ";
                  $string = str_replace($pattern, $replacement, $string);
                  // At this point ALL occurences of the word "kewl" are replaced
                  echo $string; // This will output the new page to the browser.
                  ?>
                  I tried to replace " Link#1 " with " Play " and saved it in a php file but it is not working.any help? (you can find Link#1 by clicking on a game )

                  <?
                  $url = "http://www.livescorehunter.com/Live-Streaming-Video/P2P-Links/"; // The original page
                  $string = file_get_contents($url);
                  $pattern = " Link#1 ";
                  $replacement = " Play ";
                  $string = str_replace($pattern, $replacement, $string);
                  // At this point ALL occurences of the word "kewl" are replaced
                  echo $string; // This will output the new page to the browser.
                  ?>

                  Comment

                  • navaldesign
                    General & Forum Moderator

                    • Oct 2005
                    • 12080

                    #10
                    Re: Replace words on a php page

                    These are Joomla pages, with content directly taken from the database. It can't work with such pages.
                    Navaldesign
                    Logger Lite: Low Cost, Customizable, multifeatured Login script
                    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                    Comment

                    • marsus
                      Private

                      • Jun 2009
                      • 2

                      #11
                      Re: Replace words on a php page

                      Originally posted by navaldesign View Post
                      These are Joomla pages, with content directly taken from the database. It can't work with such pages.
                      ah thanks.yes they are joomla Pages but what i dont understand is what do you mean by " with content directly taken from the database " ? they add Links from the database?

                      Comment

                      • navaldesign
                        General & Forum Moderator

                        • Oct 2005
                        • 12080

                        #12
                        Re: Replace words on a php page

                        Joomla content is generated directly from content stored in the database.
                        It is output to the browser at the moment of request. So simply fix your page to have the wording / linking you want.
                        Navaldesign
                        Logger Lite: Low Cost, Customizable, multifeatured Login script
                        Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                        DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                        Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                        Comment

                        Working...
                        X