473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Get Page Name

I am updating a site that used to be in pure HTML.

On the original site each of the 5 or so sections had links on the
front page. When you enter a section the image for the link on the nav
changes to indicate which section you are in (head to
www.yorkshirelaser.co.uk to see what I mean).

I need to replicate this on the new PHP system but am using an include
file for the navigation, so I am unable to hardcode the relevent image
on the navigation. I don't really want to post things to the query
string so wondered if anyone has a solution for figuring out which page
I am on and getting the nav to choose the relevent image for the
current section.

This must be a typical issue in PHP web development so can anyone give
me the typical way of solving this?

Only way I can think of doing this is to set a variable in each page
just before I include the nav.php file, then use this to figure out
which section the user is in - but is there a better way?
Thanks for any and all advise.

Jul 17 '05 #1
2 4255
I noticed that Message-ID:
<11**********************@c13g2000cwb.googlegroups .com> from
ri*******@e-connected.com contained the following:

I need to replicate this on the new PHP system but am using an include
file for the navigation, so I am unable to hardcode the relevent image
on the navigation. I don't really want to post things to the query
string so wondered if anyone has a solution for figuring out which page
I am on and getting the nav to choose the relevent image for the
current section.


$_SERVER['PHP_SELF'] contains the name of the current page

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #2
"user2424" wrote:
I noticed that Message-ID:
<11**********************@c13g2000cwb.googlegroups .com> from
ri*******@e-connected.com contained the following:

I need to replicate this on the new PHP system but am using an

include
file for the navigation, so I am unable to hardcode the relevent

image
on the navigation. I don’t really want to post things to

the query
string so wondered if anyone has a solution for figuring out which

page
I am on and getting the nav to choose the relevent image for the
current section.


$_SERVER[’PHP_SELF’] contains the name of the current
page


and if you want the whole url, do:

$_SERVER[’PHP_SELF’] . "?" . $_SERVER[’QUERY_STRING];

note that if querystring is empty, then a "?" is added, if that is a
problem, run code to check for QS being present.

--
Posted using the http://www.dbforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbforumz.com/PHP-Page-ftopict189432.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=640188
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Don | last post by:
I want the server-side php script to return a browser page that is essentially a copy of the original client page that contained the <form> which referenced the php script in the first place....
1
by: Michael Brennan-White | last post by:
If I submit my for using a get action the resulting page loads . If I use a post action I get an error page saying "The page cannot be found". I am calling the originating page!!! This happens...
0
by: Rary | last post by:
I am using XSL:FO to generate PDF report for my XML, generating it in tables, i want that tables should completely be at one place, if there is a page break , all the contents of the table should...
7
by: Drew | last post by:
I have a db table like the following, UID, int auto-increment RegNo Person Relation YearsKnown Now here is some sample data from this table,
0
by: Nathan | last post by:
Hi, I seem to having a peculiar problem with the display of odd and even pages in XSL-FO. Here is a small background of the problem. My xsl stylesheet mentions my fo:layout-master-set as ...
0
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
7
by: GaryDean | last post by:
In my old 1.1 apps the default was MS_POSITIONING="GridLayout" and Textboxes and labels and such always had POSITION: absolute; and I never had any distortion when the page was rendered. Life was...
3
by: Aaron | last post by:
I'm trying to parse a table on a webpage to pull down some data I need. The page is based off of information entered into a form. when you submit the data from the form it displays a...
4
osward
by: osward | last post by:
I had made a table colum sortable and paging the table, following are the code // Display Event List echo "<center>"._EVENTLIST."</center><br>"; $now = Date(Y-m-d); // sort table...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.