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
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 ?php include('phpincludes/' . $thisPage . '.php') ?
The idea behind it (I know tons of people do it, but I'm new to this
concept),
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 allenmcc...@gmail.com wrote:
I am trying to generate pages by importing content
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:
?php
if (!isset($thisPage)) {
$thisPage=about;
} else {
$thisPage = addslashes($_GET['page']);
}
?
in the head tags.
I am seeing this:
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)
On Wed, 05 Aug 2009 20:19:00 +0300, Allen McCabe allenmcc...@gmail.com
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:
?php
if (!isset($thisPage)) {
$thisPage=about;
} else {
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
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 =
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.
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 of ==:
10 matches
Mail list logo