Jump to content

[SOLVED] taking names from one page to another


irn3rd

Recommended Posts

I'm very new to php i only know how to output messages with echo and how to start a php session of at the moment learned a bit about using forms got to go back over that,

 

I'm looking to take the name of the page onto the next page the user clicks.

 

For Example if you are on the home page an you go to a page called 'about me' i want a message on the 'about me' page saying that you have come from the home page.

 

I'm going to check my form tutorials to see if i can figure it out from that, but please help be much appreciated

 

Many Thanks

I'm a little confused by your request.

 

Like a little nav-bar?

 

Let's assume you're on the home page, and follow the link the about me page, it would display the following in the nav-bar?...

 

Home > About Me

 

If not, I completely misunderstood you.

You may be able to look at the global var: $_SERVER['REQUEST_URI'];   and from there do some string manipulation to find out what the page was called.

 

$from = $_SERVER['REQUEST_URI'];

 

Although, I'm not sure how this works, I rarely use it.  Doing a small search I found this though:

 

http://www.dezinerfolio.com/2008/01/09/back-to-previous-page-php/

 

You could store the current page in a var, so when you go to the next one you'd know where you were last, if it was in your pages with sessions.

thank you very much this is what i was looking for, sorry my explanation isn't clear I'm new to php and still learning the name for certain things. Sorry about that :)

 

Ill give that a go and see how it goes.

 

Another question, i have a website where everything is .html except one php page.

 

can i use php code in a file with an extension which isn't php?

 

http://www.irn3rd.co.uk/

 

Thats my website it's still being developed

 

Thanks alot!! :)

 

Many Thanks Irn3rd

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.