|
|
2014-05-14, 10:41 AM | #1 |
Me fail English? That's unpossible!
|
Here you go. Just work off this.
Code:
<?php $todayfile = date("d-m-y") . ".txt"; // 14-05-14 = 14th of May, 2014 $text = @file_get_contents($todayfile); echo $text; ?> |
2014-05-14, 02:04 PM | #2 |
That's what she said
|
Rock'n'roll!
Thank you, very appreciated Jolly Update: It works perfectly Now you've put me on the track, the small tweaks I need I can figure out myself. Again, Last edited by jollyhumper; 2014-05-14 at 02:39 PM.. |
2023-09-14, 08:57 PM | #3 | |
That's what she said
|
Quote:
What I want it to do: Let's say I have 3 files named: 01.txt 02.txt 03.txt Can I make php pull one of them by random? J |
|
2023-09-15, 05:54 AM | #4 | |
The Original Greenguy (Est'd 1996) & AVN HOF Member - I Crop Pics For Thumbs In My Sleep
|
Quote:
Create a text file with what you want pulled randomly - for example: https://www.link-o-rama.com/greenguy...nks-header.txt (simple banner rotator) Make sure there is no extra empty line or return at the end. Then put this coding on your page: Code:
<?php $file = "/home/greenguy/domains/link-o-rama.com/public_html/greenguy/includes/mlinks-header.txt"; $banners = file($file); srand((float) microtime() * 1235689); $selected = array_rand($banners); $SelBanner = trim($banners[$selected]); if ($SelBanner=="") { $SelBanner = trim($banners[0]); }; echo $SelBanner; ?> That's running the top banner on here. (thank you cd34) |
|
|
|