Skript für Homepage

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Skript für Homepage


    Ich suche ein Skript, dass zufällig bei jedem Laden der Seite einen neuen Teil aus einer Datei rausliest und auf meine Homepage läd.

    Klingt vielleicht komisch, aber ich erklärs mal:

    Ich möchte auf meiner Homepage Stilblüten einbauen. Ich habe diese Stilblüten nun alle in einer Datei gesammelt und nun will ich, dass nun zufällig immer eine andere dieser Stilblüten beim Laden einer Seite auf meiner HP angezeigt wird, so dass da ein bisschen abwechslung reinkommt.

    Ich habe allerdings überhaupt keinen Plan von sowas und weiss auch nicht, wie man so etwas anstellen kann.

    Hat jemand ne Idee?

    dann antwortet mal bitte oder schreibt mir ne PM.



  • Danke sehr....aber gehen die Dinger auch bei Tenxten?

    Ich sehe gerade, dass die eigentlich für Bilder gedacht sind.

    Muss ich dafür, dass die funktionieren, jede Stilblüte in eine eigene Datei machen und die hochladen?


  • Ja, die Links sind für Bilder gedacht! Hatte übersehen, dass du für Text was braucht!

    Hier ein Script zum Einbau in die Seite:

    PHP Source Code

    1. <?php
    2. $quotes =array(
    3. 1=>"It's not the IQ, but the I will that counts.",
    4. 2=>"Self-motivation is the only motivation that works.",
    5. 3=>"If you want your dreams to come true, don't sleep.",
    6. 4=>"When you want to test the depts of a stream, don't use both feet.",
    7. 5=>"If you scatter thorns, don't go barefoot.",
    8. 6=>"All things are difficult before they are easy.",
    9. 7=>"Words must be weighed, not counted.",
    10. 8=>"There wouldn't be such a thing as counterfeit gold if there were no real gold somewhere.",
    11. 9=>"Advice is least heeded when most needed.",
    12. 10=>"Examine what is said, not he who speaks.",
    13. 11=>"Of two evils chose the less.",
    14. 12=>"What may be done at any time, will be done at no time.",
    15. 13=>"Everyone thinks his own burden heavy.",
    16. 14=>"He who knows little quickly tells it.",
    17. 15=>"Smooth seas do not make skillful sailors.",
    18. 16=>"Better be ill spoken by one before all than all before one.",
    19. 17=>"After the game, the king and the pawn go into the same box.",
    20. 18=>"Never trouble trouble until trouble troubles you.",
    21. 19=>"Don't throw away the old bucket until you know the new one holds water.",
    22. 20=>"If you are not living on the edge... your taking up to much room.",
    23. 21=>"You can't wake a person who is pretending to be asleep.",
    24. 22=>"Fall seven times, stand up eight.",
    25. 23=>"Winners make goals; loosers make execuses.",
    26. 24=>"People may doubt what you say, but they will beleive what you do.",
    27. 25=>"To know the road ahead is to ask those coming back.",
    28. 26=>"To deceive a diplomat speak the truth, he has no experience with it.",
    29. 27=>"Even a clock that does not work is right twice a day.",
    30. 28=>"A journey of a thousand miles begins with a single step.",
    31. 29=>"When angry, count to ten before you speak; when very angry, count to a hundred.",
    32. 30=>"I am always ready to learn, but I don't always like being taught.",
    33. 31=>"All of the flowers of all the tomorrows are in the seeds of today.",
    34. 32=>"Success is never final, and failure is never fatal.",
    35. 33=>"If you are all wrapped up in yourself, you are overdressed.",
    36. 34=>"Education makes people easy to lead but difficult to drive; easy to govern but impossible to enslave.",
    37. 35=>"There is no excellence without difficulty.",
    38. 36=>"Be bold for what you stand for, and be careful what you stand for.",
    39. 37=>"Long is the road from conception to completion.",
    40. 38=>"One can never consent to creep when he feels an impulse to soar.",
    41. 39=>"Worry never robs today of its sorrow; it only saps today of its strength.",
    42. 40=>"You can't beat a person who never gives up.",
    43. 41=>"When you throw dirt you loose ground.");
    44. $max=41; // This should be changed to the total amount of quotes
    45. $random_number=rand(1, $max);
    46. $random_quote=$quotes[$random_number];
    47. echo("$random_quote");
    48. ?>
    Display All

    Und hier mit "externer" Textdatei:…ipt=randomGenius&type=zip

    Hier noch ein anderes: