PHP Code: Using a variable to name the file in an Include

I have a series of case statements assigning a value to the
variable $theme
based on the current month. Then I have a set of files
(january.txt,
february.txt, etc.). The variable values are those file
names:
// get current month as a number
$month = date('n');
// select theme for the month
switch($month) {
case 3:
$theme = 'march.txt';
break;
case 4:
$theme = 'april.txt';
break;
[etc.]
What is the correct syntax for a PHP Include that will use
the current value
of $themes for the filename?
Thanks
Walt

<?php include('_inc/'.$theme); ?>
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"Walt F. Schaefer" <[email protected]> wrote in
message
news:gqutqv$qbf$[email protected]..
>I have a series of case statements assigning a value to
the variable $theme
>based on the current month. Then I have a set of files
(january.txt,
>february.txt, etc.). The variable values are those file
names:
> // get current month as a number
> $month = date('n');
> // select theme for the month
> switch($month) {
> case 3:
> $theme = 'march.txt';
> break;
> case 4:
> $theme = 'april.txt';
> break;
> [etc.]
> What is the correct syntax for a PHP Include that will
use the current
> value of $themes for the filename?
>
> Thanks
>
> --
>
> Walt
>
>
>

Similar Messages

  • To test how can we use the opt  'logical file name' to name the file based

    Hi Sir/Madam,
               to test how can we use the opt  'logical file name' to name the file based on the selection made in the dtp run for extracting data as flat file.

    Hi Vishali,
    In the DTP select the file location as application server and give the logical file path. The actual file and logical path can be created using transaction "FILE" and "AL11".
    Rest of the process is same as that of extraction from local file.
    Regards,
    Durgesh.

  • Why Coherence mandates to name the file as hibernate.cfg.xml ???

    Wondering Why Coherence mandates to name the file as hibernate.cfg.xml , otherwise it wouldn't work
    We use Spring 2.5, Hibernate 3.2, Coherence 3.5
    •     Currently we have created hibernate.cfg.xml to make coherence work whereas we would like to leverage existing spring configuration file
    •     We wrote separate DAO’s i.e. xxxCoherenceDAO in addition to exsisting DAO’s. We would like to inject NamedCache into **CoherenceDAO
    • How to leverage Spring to start the CacheFactory i.e. we would like to avoid the following code in our XXXCoherenceDAO's
    NameCache customerCache = CacheFactory.getCache(com.xx.Customer.class.getName());

    Take a look at the [JavaDoc for HibernateCacheLoader|http://download.oracle.com/otn_hosted_doc/coherence/352/com/tangosol/coherence/hibernate/HibernateCacheLoader.html]. It has several constructors that allow you to either provide the name of the Hibernate configuration or provide a SessionFactory created externally.
    Thanks,
    Patrick

  • Multiple drag emails from Mail to a finder window and for it to name the files as the subject heading

    Hi
    I have been using Mac's now for about 10 years and this is my first problem.
    I have recently moved into an office that use PC's with a Windows server.
    I have set up the network to transfer files and view the windows server and it  works fine.
    I have a problem in that my colleagues on PC need to be able to view my emails which I send and receive using Mail. They therefore need to have logical title names and the date sent and ideally who to or from. I view them and archive them using Mail which is fine for me.
    I understand about the archiving and copying of mailboxes but this gives every email the un-fathomable title name 9944847 etc.
    I can get round the problem by dragging and dropping every email I send and receive individually and it will automatically give it a more logical title of the subject heading however the date is when it was dragged not when sent. This is a pain if I am away or forget to save an email for a day or two and then the date is inconsistent.
    Is there a way to batch copy emails from Mail to a finder window and for it to name the files as the subject heading or to archive the files in a similar way so they retain the detailed information my colleagues require.
    And no I can not get to all change to Mac and I don't really fancy using Outlook, Entourage or Parallels.
    Please help.
    Toby

    Quit Mail. Force quit if necessary.
    Back up all data. That means you know you can restore the Mail database, no matter what happens.
    Triple-click the text on the line below to select it:
    ~/Library/Mail/V2/MailData/Envelope Index
    Copy the selected text to the Clipboard (command-C). In the Finder, select
    Go ▹ Go to Folder
    from the menu bar. Paste into the box that opens (command-V), then press return.
    A Finder window will open with a file selected. Move the selected file to the Desktop, leaving the window open. Other files in the folder may have names that begin with "Envelope Index". Move those files, if any, to the Trash. Relaunch Mail. It should prompt you to re-import your messages. You may get a warning that the index is corrupt and that Mail has to quit. Click OK.
    Test. If Mail now works as expected, you can delete the file you moved to the Desktop. If you get a warning that the file is in use when you try to empty the Trash, log out and log back in.

  • Code for reading particular  fields from the file placed in application

    hi,
    code for reading particular  fields from the file placed in application server in to the internal table.

    Hi,
    Use the GUI_UPLOAD FM to upload the File into ur Internal Table.
    DATA : FILE_TABLE TYPE FILE_TABLE OCCURS 0,
             fwa TYPE FILE_TABLE,
             FILENAME TYPE STRING,
             RC TYPE I.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
      EXPORTING
        WINDOW_TITLE            = 'Open File'
       DEFAULT_EXTENSION       =
       DEFAULT_FILENAME        =
       FILE_FILTER             =
       INITIAL_DIRECTORY       =
       MULTISELECTION          =
       WITH_ENCODING           =
      CHANGING
        FILE_TABLE              = FILE_TABLE
        RC                      = RC
       USER_ACTION             =
       FILE_ENCODING           =
      EXCEPTIONS
        FILE_OPEN_DIALOG_FAILED = 1
        CNTL_ERROR              = 2
        ERROR_NO_GUI            = 3
        NOT_SUPPORTED_BY_GUI    = 4
        others                  = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    READ TABLE FILE_TABLE INDEX 1 into fwa.
    FILENAME = fwa-FILENAME.
        CALL FUNCTION 'GUI_UPLOAD'
             EXPORTING
                  filename                = filename
                  FILETYPE                = 'DAT'
           IMPORTING
                FILELENGTH              =
             TABLES
                  data_tab                = itab
             EXCEPTIONS
                  file_open_error         = 1
                  file_read_error         = 2
                  no_batch                = 3
                  gui_refuse_filetransfer = 4
                  invalid_type            = 5
                  OTHERS                  = 6 .
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    Regards,
    Balakumar.G
    Reward Points if helpful.

  • How can I change (or select) what is being being used when I share, as the file cover. When I Share lets say "Master File" i want to select a frame that is used as the file cover. So when its on my desktop I see this image as the file icon.

    How can I change (or select) what is being being used when I share, as the file cover. When I Share lets say "Master File" i want to select a frame that is used as the file cover. So when its on my desktop I see this image as the file icon.

    I don't think Finder does this (I've tried).
    iTunes does though. Where you can set artwork or the "poster frame"...
    This may not be what you want but if it helps, I know 2 ways  do this is
    Open the video in QuicktimePlayer7 | View | Set Poster Frame (even then, you might need to save it as .mov (ie in a 'mov container').
    Drag the file into iTunes and set the artwork (as in http://www.dummies.com/how-to/content/adding-album-cover-art-or-images-in-itunes .html)
    From there, iTunes will use that frame as the "poster frame" ie the photo/frame that shows when you browse your videos. Which is what you want, but limited to iTunes.
    When I do either of these above, the frame I set does not show when exploring files in "Finder" (or in the other Explorer tool I use called "Pathfinder").
    So it maybe, that exactly what you want, is not possible.

  • When I send out mail from MS Outlook enterprise account in the office to my Mac at home they are received as "winmail.dat" files.  Even if I perform a "save as" to the correct file name the file format is still not recognized.  Why is this happening!?

    When I send out mail from MS Outlook enterprise account in the office to my Mac at home they are received as "winmail.dat" files.  Even if I perform a "save as" to the correct file name the file format is still not recognized.  Why is this happening!?

    http://www.joshjacob.com/mac-development/tnef.php

  • What kind of database the SSMA uses to store metadata in the file named "source-metabase.mb" ?

    What kind of database the SSMA uses to store metadata in the file named "source-metabase.mb" ?
    I'm looking for the method to open the file and add 'cutom migration script' (some automatization).

    Hi Poman.Pokrovskij,
    When you generate SSMA Assessment Report, there are several files created and saved into Report folder under your SSMA project folder. It includes
    source-metabase.mb, project-container.mappings, preferences.prefs, and so on.
    . MD files are usually saved in plain text format including inline text symbols, defining how a text is formatted such as the indentations, its table formatting, fonts, and headers.
    SSMA provides a project setting that allow you to customize how to set customized database migration. For example, to customize data migration SQL statement, you can modify project setting by navigating to Tools and choosing Project Settings,
    then looking for the setting for
    Extended Data Migration Options and change the value to
    Show. You can select use custom select and modify the SQL statement.
    For more information about SSMA for Oracle, you can review the following articles.How To Perform Incremental Data Migration Using SSMA:
    http://blogs.msdn.com/b/ssma/archive/2010/10/04/how-to-perform-incremental-data-migration-using-ssma.aspx
    Using SSMA Project Setting to Customize Database Migration:
    http://blogs.msdn.com/b/ssma/archive/2011/03/16/using-ssma-project-setting-to-customize-database-migration.aspx?Redirected=true
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Use environment variables in logging.properties file

    is there a way to use environment variables in logging.properties file?
    like this -
    java.util.logging.FileHandler.pattern = {$MY_BASE_LOG_FOLDER}/myapp1/log/123%g.logdo I have to write a custom logging.properties loader? if yes, then are there any examples on this?

    I'm sorry, but don't you think your answer is useless?
    Maybe I haven't made my question clear enough. I need to know if java.util.logging recognizes environment variables in logging.properties files.
    If it does not, then there should be a well-known class to use instead of standard loader for logging.properties (java api mention one briefly).

  • I'm trying to export a file as .dwg for Autocad but it's not showing the dwg preview and it appears to be saving as code (lots of gobbledegook when reopening the file).  I'm on OS 10.5.8.  Never had a problem with this before.  What am I missing? Any idea

    I'm trying to export a file as .dwg for Autocad but it's not showing the dwg preview and it appears to be saving as code (lots of gobbledegook when reopening the file).  I'm on OS 10.5.8.  Never had a problem with this before.  What am I missing? Any ideas?

    First be sure login and password are OK. Sometimes the address starts wit "http://..." and sometime starts with "ftp://...". Try both normal FTP access and Scure FTP access (SFTP). At the end, contact the site's provider.

  • When exporting from Photos, the panel for naming the file no longer shows up. Why and how do I change so I can name the file what I want?

    When exporting from Photos, the panel for naming the file no longer shows up. Why and how do I change so I can name the file what I want?

    You don't need to maintain all versions of the upgrade chain, but many of us do in case we need to work on a legacy file. If you want to rmove a version, though, ti should be done BEFORE installing the later one. Just reinstall CS5 and things should get back to normal.

  • I have Premier Elements 8.  I recorded some 45 minute lectures on a Sony Camcorder at 17 Mbps.  The resulting, edited file size is about 6.3 GB -- too big to record on a 4.7 GB DVD-R disc.  Using Adobe PE 8, can the file size be reduced in some way to end

    I have Premier Elements 8.  I recorded some 45 minute lectures on a Sony Camcorder at 17 Mbps.  The resulting, edited file size is about 6.3 GB -- too big to record on a 4.7 GB DVD-R disc.  Using Adobe PE 8, can the file size be reduced in some way to end up less than 4.7 GB (I realize image quality may be less htan the original)?

    pault
    What are you going for....DVD-VIDEO Widescreen on DVD disc or AVCHD format on DVD disc?
    Are you doing your burn to disc with a check mark next to "Fit Content To Available Space" in the burn dialog?
    When you have the DVD 4.7 GB/120 min in the burner tray and are in the burn dialog ready to hit Burn, what does the burn dialog quality area show for Space Require and Bitrate with and without the check mark next to "Fit Content To Available Space"?
    Just in case mention....the DVD disc with the 4.7 GB/120 min in reality is 4.38 GB.
    The goal is to find out if you are overlooking the "Fit Content To Available Space" option in the burn dialog. Depending on the circumstances to be defined, use of that option does not necessarily mean a compromise in the end product quality.
    Let us start here and then move forward based on the details of your reply.
    Thank you.
    ATR

  • HT4889 when using migration does it copy the files to the new computer or transfer (leaving the files only on the new computer)?

    when using migration does it copy the files to the new computer or transfer them (leaving the files only on the new computer)?

    It leaves them on the old computer. Nothing will be changed on it.

  • How to use a variable to specify the color when setting an attribute

    Hi
    We are using BI Publisher (XDO) embedded in e-Business Suite. So we are effectively on version 5.6.3.
    I would like to conditionally set the background-color attribute of cells in a table by using a variable reference; something like this (the ways in which I have tried):
    <?attribute@incontext:background-color;$exEmpBGColor?>
    <?attribute@incontext:background-color;'{$exEmpBGColor}'?>
    The 'standard' way of doing this would be:
    <?attribute@incontext:background-color;'#CCCCFF'?>
    Can anybody please help? (i.e. is this even possible?)

    Thanks that works.
    I was using a variable, so I adapted your example to use the variable, not an element.
    <xsl:attribute xdofo:ctx="block" name="background-color"><xsl:value-of select='$exEmpBackgroundColour' /></xsl:attribute>
    Regards

  • Using a variable to name a window?

    Is it possible to use a user-defined variable to name a
    window? I'm hoping to set up a "template" system of sorts for a
    family of products, all of which are very similar. I'd just like to
    name the window accordingly to the product name via a variable if
    possible.

    Hi there
    If this is a feature you feel would be a valuable addition to
    those offered by RoboHelp, consider telling the Adobe RoboHelp
    Development team about it. You may do that by
    clicking
    here and completing the form.
    Cheers... Rick

Maybe you are looking for

  • How do i sync my iphone with my itunes library and my mom's itunes library

    I just bought an iphone and was wondering how do I sync it to my itunes as well as my mom's for music. I did this with our ipods but now i can't seem to do it. The libraries are on the same computer, just different profiles.

  • How do I fully reset my Nano 2 so I can sell it

    After purchasing a touch 4g, Im ready to sell my nano 2g. i have removed the music, but how do i wipe the user info so i can sell it and the purchaser can set it up new for themselves. as of now, the serial number is attached to my account

  • HT204074 Can't find "manage devices" in itunes...

    I want to remove a device from itunes. Apple says: Removing an associated device or computer from an Apple ID To remove a device or computer from your Apple ID: Open iTunes. Sign in to your Apple ID by choosing Store > Sign In from the iTunes menu. C

  • ABAP query performance

    Dear gurus,                I want to use ABAP query. However, i wonders about its performance. Would anyone please show your opinion and experience using this tool? Is it taking long time to run this tool? Will it effect the overall performace of the

  • How to rename playlists?

    I can't seem to change the name on playlist I've created in iTunes on my ipad. Is that correct? Surely I must be able to change it without having to delete it and set up a new one?