help out a noob w/ include & switch?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,
        My very first post to this group as I'm a freshly spanked new born php
baby. Hope I have the correct stop for noob tech questions. Please
re-direct me if I have it wrong. I've been doing web dev for a quite while
with a variety of methods (html, xhtml/css, cfml, flash/as, on and on...).
I work mainly for non-profit organizations and thought it was about time to
get away from commercial software. I'm doing my first site now w/ a
XHTML/CSS template that uses PHP to insert data from a switch container and
from a MySQL db. 

My problem occurs only on the server (NT 5 b.2195, PHP 4.3.10, IIS 5.0) but
works great on my dev rig (XAMPP 1.4.15, VectorLinux).

My template "index.php" uses 'include' to get '$vars' from two files. one
for the body text and title, and the other for the navigation. Click on a
link in the navbar and index.php reloads with the new navbar and the
associated content each into it's <div>. Works great on my test rig but the
server the site will be hosted from ignores the urlencoded vars and just
loads the switch defaults. For whatever reason I tried return() instead of
break. Again, it worked on my rig but not the server. I know i'm missing
some dumb little thing but I have not figured out what yet. I also tried
session_unset() at the beginning of the index.php in case the problem was
with caching. Didn't work either but may be due to incorrect usage. Any
help or advice is very greatly appreciated!!

jt.

index.php:
<?php
        include 'content.php';   //sets the section title
        echo $title;
?>
<?php
        include 'navigate.php';  //sets appropriate navigation menu
        echo $navigate;
?>
<?php
        echo $content;   //loads body text
?>

content.php:
<?php
switch ($cont)
{
        case artist1:
                $title = 'event title';
                $content = '<p>some text</p>

                <p>some more text</p>

                <p class="sig">- artist name</p>';
                break;
        case artist2,3,4:
                [...]
                break;
        default:
                $title = 'event title';
                $content = '<p>some text</p>

                <p>some more text</p>

                <p class="sig">- artist name</p>';
                break;
}
?>

navigate.php:
<?php
switch ($nav)
{
        case 1:
                $navigate = '<ul><li><a href="index.php?nav=1&amp;cont=artist1">Link
title<br />by artist1</a></li><li><a
href="index.php?nav=2&amp;cont=artist2">link title<br />by
artist2</a></li><li><a href="">some more stuff</a></li><li><a
href="">Contact</a></li></ul>';
                break;
        case 2,3,4:
                [...]
                break;
        default:
                $navigate = '<ul><li><a href="index.php?nav=1&amp;cont=artist1">Link
title<br />by artist1</a></li><li><a
href="index.php?nav=2&amp;cont=artist2">link title<br />by
artist2</a></li><li><a href="">some more stuff</a></li><li><a
href="">Contact</a></li></ul>';
                break;
}
?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux