Jump to content

story97

Members
  • Posts

    14
  • Joined

  • Last visited

Posts posted by story97

  1. again, the only thing I can figure is I'm not explaining this right. instead of having 10 files each named differently with a different second include, i need to write a statement that will change the name of the second include based on what is on the URL since I know I can establish varibales using the URL string with ? & and =

  2. I did, i wrapped it in php and followed the url

     

    Some of the things didn't make sense to me. i thought this would just require an if statement and a _GET to see what i put after the URL, and include the corresponding file. so if the URL ended ?lessonq1 then the second include would bring in the file named lesson1, which is an html template

    <?php
    if (isset($_GET['file']) && $_GET['file']<>'')
    {
    $file = strtolower($_GET['file']);
    if (array_key_exists($file,$files_ar))
    $include_name = $files_ar[$file];
    else
    die("Invalid url value");
    include('header.php');
    include($include_name);
    include('footer.php');
    exit();
    }
    else
    die("Missing url value")
    exit();
    ?>
    
  3. Actually i thought taht WAS the entire code. so wrap in php and go? then the call would be site/index.php?lesson1

     

    just so you know, i know absolutely nothing about writing php. I can recognize things, but i am not a developer. i thought you meant to construct it just like that

  4. See if I can explain this right.

     

    I am currently using static files for a very basic set of pages.

     

    Right now i have a main file that has three includes. a header include, body and footer.

     

    Due to needing to add pages, i don't want to keep adding more and more files. instead I want to use php to change one of the includes based on the url.

     

    so thissite.com/index.php?lesson1 would  change this

    <?php include("header.php"); ?>
    <?php include("content-lessons.html"); ?>
    <?php include("footer.php"); ?>
    

    to this

    <?php include("header.php"); ?>
    <?php include("lesson1.html"); ?>
    <?php include("footer.php"); ?>

    or whichever way would be the best way to set the second include.

     

    my guess was that if the second line had something like this?

    if(isset($_GET['lesson1'])){
    include('include/in-'.$_GET['lesson1.html']

    can someone give me a starting place here? i am pretty sure i can pick ti up if someone gets me going in the right direction.

     

    thanks a ton.

  5. Hello,

    I'm a designer, not a coder, but I'm in need of a little help.

    The site i'm working on now has a flash header and menu. This can be a problem for people with Active-X turned off. So I want to offer an option.

    Load the site using the flash. Right under the menu, have a link "Non flash site". Now, by itself this might be simple. but again, i'm not a programmer. I'd like this setting stored in a persistent cookie so the user only has to see things they don't want to once.

    Is this too broad of a question?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.