what php allow me to do this

Discussion in 'PHP' started by kezhu911, Mar 16, 2009.

  1. #1
    hi, I just need help to know what php script will allow you to edit the same link on mutli webpages with just one simple edit, for example if I have the code over hundreds of pages, and I would to edit the code, whats the fastest way to do so, thanks
     
    kezhu911, Mar 16, 2009 IP
  2. steelaz

    steelaz Peon

    Messages:
    47
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I guess the quickest way to do it is have your link(s) in separate file, for example links.txt or links.html and then in the document include the file like this:

    <?php include 'links.html';?>
    PHP:
    But there are better ways.
     
    steelaz, Mar 16, 2009 IP
  3. Korrupt

    Korrupt Well-Known Member

    Messages:
    1,415
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    115
    #3
    I would recommmend the above method told by steelax since it's faster, however if you've already made your website and want to edit the link, you can use any free software like NotePad++ etc. to "Find in files" and replace it via the replace option. Can't think of anything faster and easier than that...
     
    Korrupt, Mar 16, 2009 IP
  4. kezhu911

    kezhu911 Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    yes I already did that, but I can still use find in files, and replace all link in php format, but what I need is actually a php code to replace another ad script, I have over hundreds of webpages, whenever I need to just replace an ad code use the find in files method gonna take very long time to replace all ad code, that's why I want a better solution:confused:
     
    kezhu911, Mar 16, 2009 IP
  5. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Store your ads or ad links in a database.
     
    SmallPotatoes, Mar 16, 2009 IP
  6. kezhu911

    kezhu911 Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    what exactly thing do I have to do? thanks
     
    kezhu911, Mar 17, 2009 IP
  7. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #7
    why don't you just use an include-file on the webpages? Then all you would have to do is upload a new file for inclusion to the pages using the ads.

    eg:

    include.html
    contains the ads that are gonna be shown on the webpages

    webpages.php
    each webpage contains the <?php include ('include.html'); ?> where the ads are supposed to be shown

    if you need to change some of the ad-code, you just change the one file, the include.html, and upload it to the web-server

    Wouldn't that work just fine?
     
    PoPSiCLe, Mar 17, 2009 IP
  8. kezhu911

    kezhu911 Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    those above method just working for me, maybe I should say it this way, to creating another webbrower on my website, and it display from the page where my ad is at.
     
    kezhu911, Mar 17, 2009 IP
  9. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #9
    Well... if you want to get the ad from another server/page, include it on the other webpages in an iFrame - then you'd just have to update the one page the ad is pulled from.

    Note that this will put a tremendous strain on the server you pull the ads from, since, as you say, you have hundred of websites, and each of them will pull an ad every time the page is refreshed, or someone goes to other pages that has the ads embedded.

    It is not a recommended solution.
     
    PoPSiCLe, Mar 18, 2009 IP