Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Go Back   Code Forums > Application and Web Development > PHP
User Name
Password

Reply
 
LinkBack Thread Tools Display Modes
Old 07-06-2005, 05:12 AM   #1 (permalink)
SpikeNexus
Registered User
 
Join Date: Jul 2005
Posts: 2
SpikeNexus is on a distinguished road
php linking problems

Greetings,

Having been told about the advantages of having a website use php instead of just html, I have decided to re-write a website of mine in php to rid it of frames.

I've managed to include all the appropriate pages in my index.php and get them showing up where they're supposed to, however I'm having what seems to be a small problem with linking the pages.

My situation is as follows:

I have two navigation bars - one included in the header section of the page, and one to the left of the central content area. The links in the header page are to load pages in the left navigation bar, and any links in the left 'navbar' are to load pages in the central content area.

Pages to load in the left navbar are linked using index.php?navbar=page
Pages to load in the central area are linked using index.php?location=page

This does work to an extent. The pages do load in their respective areas. However, for example, when following a link to a index.php?location=page page, regardless of what the previously specified index.php?navbar=page page is, the navbar will reload to its default page, specified using,

if (empty($navbar)) {
$navbar='default';
}

This occurs vice-versa, as well.

I have tried numerous ways of preventing the pages from doing anything, but have had no success. I really don't have extensive knowledge in php, so I don't think that if I can't make it work, then there's no way it is going to work, but I'm out of ideas.

I'm wondering if anyone else has any ideas on how I'd go about setting this problem right; they'd be much appreciated.

I have set up an example of what my problem is, at
http://spikenexus.toxicsheep.com/txv/index1b.php
should anyone want to see it in action.

Thanks.
__________________
SpikeNexus is offline   Reply With Quote
Old 07-06-2005, 08:00 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,680
redhead is on a distinguished road
You will have to either set a cookie, telling you what previus selection was made in the opposite menu, or parse that along in the link aswell ie:
PHP Code:
echo "<a href=\"$PHP_SELF?location=$_GET[location]&navbar=$_GET[navbar]\">link</a>"
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 07-06-2005, 10:00 PM   #3 (permalink)
SpikeNexus
Registered User
 
Join Date: Jul 2005
Posts: 2
SpikeNexus is on a distinguished road
Thanks

Including it into the link seems to make sense. I had thought of doing something to that effect before posting here, but I wasn't sure exactly how I was going to achieve it.

I will impliment your code into my pages tonight and see what happens.

Thanks for the help, redhead.
__________________
SpikeNexus is offline   Reply With Quote
Reply


Thread Tools
Display Modes

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP 5.0.4 and 4.3.11 Released sde Code Newbie News 0 04-20-2005 10:56 AM
PHP to Flash control panel roccoman PHP 1 11-24-2004 08:10 AM
PHP vs .NET Redline Lounge 1 11-24-2004 06:10 AM
PHP Comes of Age sde Code Newbie News 0 04-14-2004 11:41 AM
I need to learn PHP Nitro PHP 9 06-28-2003 11:24 AM


All times are GMT -8. The time now is 06:24 PM.


Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2006, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
Open Circle