Miscellaneous Code

  Home arrow Miscellaneous Code arrow Random Link Load-sharing script
MISCELLANEOUS CODE

Random Link Load-sharing script
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2003-12-23

    Table of Contents:

     
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement
    If you have a backup server running a second copy of your site, and would like to share the load, this is the script for you!

    Just add a web address to each line of the file "random.txt" and put this code on your index page.

    (you will need to have a second index page on your primary server, one "index.htm" or whatever with this code in it, the other "index2.htm" or whatever with your normal index page.

    There are probably better ways of load-sharing, but this is dead simple. let me know what you think! you can use this code free, but if you use it, e-mail me and give me a URL!info@dragondesigns.org.uk

    By : WelshFlyer

    <html>
    <head><title>Redirect</title>
    <?php
    $textfile ="random.txt";

    $items = file("$textfile");
    $item = rand(0, sizeof($items)-1);

    ?>

    <meta http-equiv="Refresh" content="1; URL=<?php print"$items[$item]" ?>">


    </head>
    </html>
    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More Miscellaneous Code Articles
    More By Codewalkers

    blog comments powered by Disqus

    MISCELLANEOUS CODE ARTICLES

    - Creating a Web Page Controller with the HMVC...
    - Coding Controllers and Views for the HMVC De...
    - A Sample Web Application with the HMVC Desig...
    - Adding a Class to Parse Views to an HMVC Des...
    - Building a Model Class for the HMVC Design P...
    - Filtering Input Data and Generating HTML For...
    - The HMVC Design Pattern: Working with MySQL ...
    - Dispatching Requests to MVC Triads with the ...
    - Implementing the Hierarchical Model-View-Con...
    - A Web App Based on a Model for the CodeIgnit...
    - Completing a Model for the CodeIgniter PHP F...
    - Validating Input Data with the CodeIgniter P...
    - Deleting Database Records with the CodeIgnit...
    - Inserting Database Records with a CodeIgnite...
    - Fetching Database Rows with a Model for the ...


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 5 - Follow our Sitemap