WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : navbar.php3 - Dynamic hyperlinked navigation bars
Categories : HTML and PHP, Arrays, PHP, Complete Programs Update Picture
Dougal Campbell
Date : Jul 25th 1998
Grade : 3 of 5 (graded 6 times)
Viewed : 12723
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Dougal Campbell
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

<?php
/*
* navbar.php3 -- Version 1.0, 98/07/24
*
* Provides a common navigation bar to a set of pages,
dynamically
* making sure that the link to the current page isn't
hyperlinked.
*
* Dougal Campbell <dougal@gunters.org>
* http://www.gunters.org/~dougal/
*
* TODO:
* o Read array from a flat text file
* o Read array from database
* o Support for graphical buttons instead of just text
* o Support for frame targets
*
*/

/* User configurable variables */

$links_arr = array(
"Test Page 1" => "/~dougal/test1.phtml",
"Test Page 2" => "/~dougal/test2.phtml",
"Test Page 3" => "/~dougal/test3.phtml"
);

$separator = " | "; /* Put a vertical bar between links */

/* Main code begins here */

/* Step through the array.... */
for (reset($links_arr); $name = key($links_arr); next($links_arr)) {

$hyper = 1; /* Hyperlink on by default */

/*
* If the current page URI matches the current array
element,
* don't add the <A HREF....> stuff. Use the $hyper var to
flag it.
*/
if ($REQUEST_URI == $links_arr[$name]) {
$hyper = 0; /* Don't hyperlink a page to itself */
}

/* Conditionally do the <A HREF...> part for hyperlinks */
if ($hyper) {
print "<A HREF=\"" . $links_arr[$name] . "\">";
}

print $name; /* Print the name of the link */

if ($hyper) { print "</A>"; } /* Close the hyperlink */

/* Do fancy tricks to print separators between links
* The next/prev stuff keeps it from putting a trailing '|'
* at the end of the list by testing to see if we are
currently
* looking at the last element of the $links_arr array.
*/
if (next($links_arr)) { print $separator; prev($links_arr); }
}
?>



Simple script to passing persistent and growing array between recalls of one page (manipulate little stack).
Categories : Arrays, Global Variables, PHP, HTML and PHP, Variables
phpCards - PHP/mySQL postcard script with web based admin to add, edit, and delete cards and categories. Very easy to install.
Categories : PHP, Complete Programs, HTML and PHP, MySQL
Select with current month
Categories : PHP, HTML and PHP, Date Time, Arrays
phpWebCam v1.0- Webcam management software - Automatically checks if you're online, and comes with a caption tool capable of handling multiple users.
Categories : PHP, Complete Programs, HTML and PHP
Validator 98 - a PHP-script to generate form-validation-code in JavaScript.
Categories : Complete Programs, Java Script, PHP, HTML and PHP
Tag content retrieval from websites with preg_match
Categories : PHP, Regexps, Arrays, HTML and PHP
How to pass an array from one PHP Script to another via an HTML form
Categories : PHP, HTML and PHP, Arrays
dynamic table columns
Categories : PHP, HTML and PHP, Arrays, Databases, MySQL
Print out array key => value in colored HTML
Categories : PHP, Arrays, HTML and PHP
Form Submission Using Array's
Categories : PHP, HTML and PHP, Beginner Guides, Arrays
This is a redirection program which is as good as the come.to v3 url redirection, complete with admin interface all clients stored in mysql
Categories : PHP, MySQL, Ecommerce, HTML and PHP, Complete Programs
PHP mySQL learning example This is a complete program to modify tables in a mySQL database on a nice and neat way.
Categories : PHP, MySQL, Complete Programs, HTML and PHP
A simple bubblesort that takes 2 arrays as argument.The first one is the actual data used for sorting, the second is data that will "tag along" with the first array, for instance a descriptive text about the data in the first array.
Categories : Algorithms, Arrays, PHP, Complete Programs
AITSH Statistics
Categories : Complete Programs, Databases, HTML and PHP, Sessions, PHP
Parsing html tags with php. Get an array from this function
Categories : PHP, HTML and PHP, Arrays, Tag Extractors