Jump to content

karmaB

Members
  • Posts

    7
  • Joined

  • Last visited

karmaB's Achievements

Rookie

Rookie (2/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Understood. Thank you for the information.
  2. What happens to email being sent to us during this?
  3. ...and thank you for the friendly welcomes too...
  4. YEEEHAAAWWWWW! Thank you guys soooooo much!!! The 0 did the trick. The stupid thing is I was going to try that last night when I was so danged frustrated but got totally sidetracked with another thought. Thank you thank you thank you! L
  5. Just tried that and it echos nothing. Just a blank space. It's like no file is actually being plugged in there...even in the original error, it said "Failed opening '' for inclusion" like its not actually including anything at all. ?? Mind you, I don't honestly know what I'm talking about.
  6. Thank you for helping! When I tried include($todaysFile[$x]); the error is the same. When I tried include $_SERVER['DOCUMENT_ROOT'].'/'.$todaysFile[$x]; the error is: Warning: main(/home/blah/public_html/): failed to open stream: Success in /home/blah/public_html/todaysFile.php on line 24 Warning: main(/home/blah/public_html/): failed to open stream: Permission denied in /home/blah/public_html/todaysFile.php on line 24 Warning: main(): Failed opening '/home/blah/public_html/' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/blah/public_html/todaysFile.php on line 24
  7. Hello. I am newly registered here and have been a customer of TCH for a couple years now... I hope someone can help me with my problem. I'm kind of a PHP dunce and what seems to be simple isn't turning out to be so. Here's what I've got: I am trying to use this script I found to include a certain file based on the current day of the month. So, on the 1st it will include file1.txt, the 2nd will include file2.txt, etc. I'm including the script on one of my pages so the designated text file will be shown (ideally) on the page for each day of the month. Here's the code...if you see that I've formatted something incorrectly, please help! --------The Files--------- 1- File that calculates: todaysFile.php 2- Result Page - test.php: <? include('todaysFile.php');?> 3- Files to be included: file1.txt, file2.txt, file3.txt, file4.txt, file5.txt, file6.txt, file7.txt ------------------------------- Here is everything inside todaysFile.php: <?php $totalFiles="7"; // Total files to pull from $todaysFile = Array ( // Up to 31 '1' => 'file1.txt' , // Name of or Path to file '2' => 'file2.txt' , // Name of or Path to file '3' => 'file3.txt' , // Name of or Path to file '4' => 'file4.txt' , // Name of or Path to file '5' => 'file5.txt' , // Name of or Path to file '6' => 'file6.txt' , // Name of or Path to file '7' => 'file7.txt' , // Name of or Path to file ); // Place day of month in variable 'x' $x=date("d"); // If value of date exceeds the amount of files then pick a random file to display if($x > $totalFiles) { $x=rand(1,$totalFiles); } // Display file include("$todaysFile[$x]"); ?> And here is the error on test.php when all is said and done: Warning: main(): Failed opening '' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/blah/public_html/todaysFile.php on line 24 It looks to me like it isn't actually requesting the file to be included...like it can't open a file that isn't named. I know this has got to be something simple but I don't know enough to figure it out. Please help if you can! Thank you so much. L
×
×
  • Create New...