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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.