At 10:00 AM -0700 8/5/09, Allen McCabe wrote:
-snip-
If this sounds like something you are familiar with (former issues and
whatnot) please let me know what I'm doing wrong.
Try this:
http://sperling.com/examples/include-demo/
If you follow what's given there, you'll be further along on incl
On Wed, Aug 05, 2009 at 02:55:07PM -0700, Ben Dunlap wrote:
> > In my navigation.php include file, I had if ($page = about) echo href
> > I changed it to if ($page == about) echo and it suddenly
> worked! Imagine
> > that...
>
> Another good case for putting the variable on the right side
Yes, that's a golden rule for a bug free code.
The rule shoudl be something like this...
Whenever you have a constant value evaluated to a non-constant value
put them in the left side of the expression.
if( 'constant' == $non_constant )
echo ' variables has that name for anything ';
if( fals
> In my navigation.php include file, I had if ($page = about) echo href
> I changed it to if ($page == about) echo and it suddenly worked! Imagine
> that...
Another good case for putting the variable on the right side of "==":
if ("about" == $page)
Then if you mis-type "==" as "=", PH
I just wanted to let know I figured out my last issue (last as in, for now).
In my navigation.php include file, I had if ($page = about) echo href
I changed it to if ($page == about) echo and it suddenly worked! Imagine
that...
Thanks all for you help, you are celebrities in my book now.
You are using a value-filled array as a key-filled. Try this snippet
and look the results...
$pages = array('about' , 'services', 'portfolio', 'contact');
$page = array_key_exists( 'page', $_GET ) ? $_GET[ 'page' ] : 'about';
/*if*/ false === array_search( $page, $pages, true ) && (
$page
Okay, I see how href="?page=contact" would work, and I do indeed have only
one file (which loads includes), but it still is not working. Clicking a
link, be href=?page=contact, href=?page=services, whatever, it still loads
the page with the ?page=whatever attached to the URL, but it is not
subsitut
On Wed, 05 Aug 2009 20:19:00 +0300, Allen McCabe
wrote:
Sure.
When I load my site, default.php loads ( displaying:
http://uplinkdesign.hostzi.com/ in the browser as expected). $thisPage is
set to "about" via:
in the tags.
I am seeing this:
The first 2 includes work just fine, loading
I think you are looking for something like this:
$page = array_key_exists( 'page', $_GET ) ? GET['page'] : 'index';
Then you MUST sanitize the $page variable.
I often use the querystring to wrapp the module you are requesting:
www.example.org/?path/to/molude (note that .htaccess is required)
#
Sure.
When I load my site, default.php loads ( displaying:
http://uplinkdesign.hostzi.com/ in the browser as expected). $thisPage is
set to "about" via:
in the tags.
I am seeing this:
The first 2 includes work just fine, loading to proper middle section and
proper right-hand-side page conte
I'm having trouble understanding your description of the problem. Can you
tell us what you're seeing and what you expect to see?
Jerry Wilborn
jerrywilb...@gmail.com
On Wed, Aug 5, 2009 at 12:00 PM, Allen McCabe wrote:
> I am trying to generate pages by importing content in includes, and using
I am trying to generate pages by importing content in includes, and using my
navigation include to tell PHP to replace a $thisPage variable which all the
includes use
The idea behind it (I know tons of people do it, but I'm new to this
concept), is to have a 'layout' page where only a variable ch
12 matches
Mail list logo