Hi i have been studying php,html,css and java for about 4 years now and there is one code that i have played around with done what i think i can do but it still does not work.
//here is the code that has something wrong with it
<?php $month = date("F");
include("calender/$month.txt"); ?>
/ end of code
I have proberly misses somthing but please help
Help with this code
Moderator: General Moderators
- KrypticNinja
- Forum Newbie
- Posts: 16
- Joined: Thu Mar 18, 2010 6:14 pm
Re: Help with this code
I'm guessing it keeps looking for a file called $month.txt, instead of the actual month.
you could call the include like this:
include("calendar/". $month . ".text");
I've had a lot of simmilar problems myself. Apparently it has something to do with the way PHP interprets strings with double quotes. I've also seen people use curly brackets {} around variables in strings, that seems to help as well.
Hope that helps.
you could call the include like this:
include("calendar/". $month . ".text");
I've had a lot of simmilar problems myself. Apparently it has something to do with the way PHP interprets strings with double quotes. I've also seen people use curly brackets {} around variables in strings, that seems to help as well.
Hope that helps.
Re: Help with this code
<?php $month = date("F"); include("calender/".$month.".txt"); ?>
changed to that and still no hope
i dont know what else to try
changed to that and still no hope
i dont know what else to try
- KrypticNinja
- Forum Newbie
- Posts: 16
- Joined: Thu Mar 18, 2010 6:14 pm
Re: Help with this code
it may help if you post the code, seeing it all together may help to find the problem.
Re: Help with this code
that is it its at the top of the last reply
- flying_circus
- Forum Regular
- Posts: 732
- Joined: Wed Mar 05, 2008 10:23 pm
- Location: Sunriver, OR
Re: Help with this code
Code: Select all
<?php
$month = date("F");
include_once("calender/".$month.".txt"); // Includes "calender/March.txt"
?>What error message are you getting? How does it "not work"?
Re: Help with this code
hi sorry it workes now the file was called march.txt not March.txt
thanks for your help
thanks for your help