PDA

View Full Version : PHP newie needs help.


Switch17
11-02-2002, 09:25 PM
With the help of all of you, I've progressed pretty far in building a fantasy football website this year. However, I am still pretty new at PHP, and am currently stuck on a current problem

All of my files generally begin with the following 0207, 0208, 0209, etc signifiying the year and then week, thus its season 2002, week 8, etc.

There are all assigned a variable to identify. The report I'm trying to call in is $FL[32], in which the file is actually 0209_miniscoreboard.php

I call the file in directly, if I type
<?php
include "0209_miniscoreboard.php";
?>

As the actually file will be 0210 next week, But what should the line be to call the variable $FL[32] instead?

Thanks for your help
Switch

laughbiz
11-03-2002, 01:01 AM
I gather you mean your array element $FL[32] contains a string which is the name of the file containing the required report?

If so then you could use:

include($FL[32]);

Alternatively copy the string from the array to a temporary variable and pass that to the include function instead.

Hope this is what you were after?



http://www.laughland.biz
"the web site for web sites"

mordred
11-03-2002, 10:19 AM
You are a little unclear, Switch. What I understand from your post is that you want to automatically include a file with a name that is put together from a year and a week value. Initially, I thought you wanted to do this for the actual week and year values, so


include date("yW") . "_miniscoreboard.php";


would serve you the file according to the date at the moment. But as next week is not the 10th, I don't understand where do you get the week and year values from in this case?