Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Refreshing just an include file
Old 05-26-2005, 06:26 PM Refreshing just an include file
the12thplaya's Avatar
Experienced Talker

Posts: 38
Trades: 0
Hi

I'm setting up a php menu for a site that has no frames, the menu is a seperate file being included in a table cell. I need to refresh the menu, because when an option is clicked it will change the menu by either adding more options or removing some, depending what was clicked at the time.

Is there a way to refresh just that included menu file without refreshing the whole page please?

Thanks
the12thplaya is offline
Reply With Quote
View Public Profile Visit the12thplaya's homepage!
 
 
Register now for full access!
Old 05-26-2005, 06:52 PM
pr0jekt's Avatar
Skilled Talker

Posts: 60
Location: Victor Harbor, South Australia
Trades: 0
i dont think that is the way php works. no easy solution to ur problem
__________________

Please login or register to view this content. Registration is FREE


Im new here so play nice :)
pr0jekt is offline
Reply With Quote
View Public Profile Visit pr0jekt's homepage!
 
Old 05-27-2005, 03:41 AM
the12thplaya's Avatar
Experienced Talker

Posts: 38
Trades: 0
Ok thanks, I'll try a few more things before giving up and going back to using frames
the12thplaya is offline
Reply With Quote
View Public Profile Visit the12thplaya's homepage!
 
Old 05-27-2005, 06:01 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You can't in php without a round trip, but you can use javascript to show or hide elements.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-27-2005, 06:12 AM
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
Better avoid frames due to SE reasons. If your page is not very large (under 30K) it is quite OK if you will reload it after click on menu item.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 05-27-2005, 02:03 PM
the12thplaya's Avatar
Experienced Talker

Posts: 38
Trades: 0
Quote:
Originally Posted by mtishetsky
Better avoid frames due to SE reasons. If your page is not very large (under 30K) it is quite OK if you will reload it after click on menu item.
This may seem a silly question, but how do I refresh the whole page that the menu is being include on? I'm designing the menu on one page which gets included on all pages, so later on I can easily edit the one menu which will take effect on all pages.

So I need a way for the included menu to know what page it's currently sitting in and refresh that page when someone clicks on a link, to view more options or hide certain options
the12thplaya is offline
Reply With Quote
View Public Profile Visit the12thplaya's homepage!
 
Old 05-27-2005, 02:17 PM
the12thplaya's Avatar
Experienced Talker

Posts: 38
Trades: 0
I found a way to refresh the correct page. On every page but the menu, store in a super global variable the current url, then use that variable when refreshing.

Thanks for your help
the12thplaya is offline
Reply With Quote
View Public Profile Visit the12thplaya's homepage!
 
Old 05-27-2005, 03:28 PM
foobar's Avatar
Extreme Talker

Posts: 225
Trades: 0
You don't need to save the URL in a Super global. There's already one created for you by PHP.

Use $_SERVER['PHP_SELF'] rather than create a new superglobal.
foobar is offline
Reply With Quote
View Public Profile Visit foobar's homepage!
 
Old 05-27-2005, 04:25 PM
the12thplaya's Avatar
Experienced Talker

Posts: 38
Trades: 0
Quote:
Originally Posted by foobar
You don't need to save the URL in a Super global. There's already one created for you by PHP.

Use $_SERVER['PHP_SELF'] rather than create a new superglobal.
I used roughly the same thing, at the top of each page but the menu I used:

Code:
$_SESSION[currentPage] = $PHP_SELF;
On the menu page when calling the variable I used this at the top of the page:

Code:
$currentPage = $_SESSION[currentPage];
and on the links I used:

Code:
<a href='<?php $currentPage ?>?country=A'>A</a>
the12thplaya is offline
Reply With Quote
View Public Profile Visit the12thplaya's homepage!
 
Reply     « Reply to Refreshing just an include file
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.33957 seconds with 12 queries