im wondering if anyone can help me as im new to php. I have a database driven php webpage that contains a menu at the top of each page called "top_template.php".. when a link is clicked to load a new page, it automatically reloads this "top_template" with a --- require "top_template.php"; --- command in the main body part of the page. however, there will be some times when i need to load up a different menu at the top depending on what the previous page was. so i was wondering if php has commands in it that will allow for an IF statement along the following lines: if the referer (the page link that referred to this new page) == "menu1.php" THEN require "menu2.php" ELSE require "menu1.php" or if menu2 is visible THEN require "menu2" ELSE require menu1 it is just the direct syntax of these statements i need as it is written above, if anyone could help me i would be extremely grateful!!