You are here: Re: Problem creating working array value pair « PHP Programming Language « IT news, forums, messages
Re: Problem creating working array value pair

Posted by the DtTvB on 06/14/06 14:43

Here is my method.
<?php
$allpages = array(
'home' => 'Home Page',
'purpose' => 'Purpose',
'spiritgifts' => 'Spiritual Gifts',
'potential' => 'Reaching Potential',
'weightloss' => 'Weight Loss',
'gifts2' => 'Spiritual Gifts 2',
'gifts3' => 'Spiritual Gifts 3',
'links' => 'Links',
'plan' => 'The Plan',
'plan2' => 'The Plan',
'plan3' => 'The Plan'
);
// Make an associative array by use its key as page name.

if (!isset($allpages[$thispage = $_GET['page']]))
$thispage = 'home';
// If the requested page does not exists, just show the home!

$title = $allpages[$thispage];
// Get its title.

echo "<h1>$title</h1>";
// Display its title to test.
?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация