473,468 Members | 4,274 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

php links "breaks" each other

Hi!

Sorry for the stupid subjekt, but coudn't get it better.
I want that the user can chouse the skin of the site that I do by :

**********************************************
<?
if(empty($_GET['style'])){
$_SESSION['stylesheet'] = "master";
}
else {
$_SESSION['stylesheet'] = "jojje";
}
echo '<style type="text/css" media="all">@import
"'.$_SESSION['stylesheet'].'.css";</style>';
?>

///////

Change skin to:
<br>
<a href="?style=jojje"> Jojje</a>
<br>
<a href="?"> Default</a>
<br>
************************************************

then I use similary metod for the meniu:
************************************************
<?php
switch($_GET['page']){

case 'banner':

include('banner.html');

break;
default:

include('main.php');
}
?>
///////

<a href="?page=banner">Banner</a>

************************************************

well abbiosly it don't work... whats heppends is that when I change
skin to jojje and click om banner link the banner page is getting
loadet but made skin choise disappears ....

so please can somebody help my to get to follow upps to work!
getting desperate....

thanx in advance
Jul 17 '05 #1
8 1942
carramba wrote:
<?
// if there is no "style" in the URL if(empty($_GET['style'])){
// change "stylesheet" to default $_SESSION['stylesheet'] = "master";
}
// if there is a "style" in the URL else {
// change "stylesheet" to jojje $_SESSION['stylesheet'] = "jojje";
}
I think you need to refine the first part of this if() to something like:
if there is no "style" in the URL
AND the "stylesheet" is not previously defined
echo '<style type="text/css" media="all">@import
"'.$_SESSION['stylesheet'].'.css";</style>';
?>

///////

Change skin to:
<br>
<a href="?style=jojje"> Jojje</a>
<br>
<a href="?"> Default</a>


Maybe better, in accordance to the redefined if()

<a href="?style=master"> Default</a>
and then change the else part of the if() to use the value of "style"
from the URL instead of the constant "jojje".
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #2
Thank you very mutch
Jul 17 '05 #3
well, it's work very fine untill you want to change the style back to
default.
ex if Iam on banner page (not index) and I change the style I ll get
chucked to index page with default style...

how can I prevent this?
Jul 17 '05 #4
carramba wrote:
well, it's work very fine untill you want to change the style back to
default.
ex if Iam on banner page (not index)
something like http://www.example.com/banner.php in the URL?
and I change the style
how?
by going to http://www.example.com/index.php?style=master
I ll get chucked to index page with default style...
Well ... that's the script specified in the URL!
simply make that URL be http://www.example.com/banner.php?style=master
and do the style change for all pages.
how can I prevent this?


Hint:
make the style changing script a file apart and include (I prefer
require_once) it on all pages.
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #5
Pedro Graca <he****@hotpop.com> wrote in message news:<c2*************@ID-203069.news.uni-berlin.de>...
something like http://www.example.com/banner.php in the URL?
no, like http://swd.localhost/pj.php?page=banner
Iam using GET here as well

switch($_GET['page']){

case 'banner':

include('banner.html');
break;

how?
by going to http://www.example.com/index.php?style=master
I ll get chucked to index page with default style...


Well ... that's the script specified in the URL!
simply make that URL be http://www.example.com/banner.php?style=master
and do the style change for all pages.
how can I prevent this?


Hint:
make the style changing script a file apart and include (I prefer
require_once) it on all pages.

it still works same way as before... when I have changet style I can
surf with it in all othet pages, but if I cnage style again I ll get
into index page..
Jul 17 '05 #6
carramba wrote:
Pedro Graca <he****@hotpop.com> wrote in message news:<c2*************@ID-203069.news.uni-berlin.de>...
something like http://www.example.com/banner.php in the URL?
no, like http://swd.localhost/pj.php?page=banner
Iam using GET here as well

how?
by going to http://www.example.com/index.php?style=master

it still works same way as before... when I have changet style I can
surf with it in all othet pages, but if I cnage style again I ll get
into index page..


It seems you are *always* going to
http://swd.localhost/pj.php
and use parameters to specify the page and style

So http://swd.localhost/pj.php?page=banner shows the banner page in
the previously selected style

http://swd.localhost/pj.php?style=gold changes style to "gold" and
shows what page? ???

http://swd.localhost/pj.php?page=banner&style=silver would (I
guess) show the banner page in the "silver" style
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #7
Pedro Graca <he****@hotpop.com> wrote in message news:<c2*************@ID-203069.news.uni-berlin.de>...
carramba wrote:
Pedro Graca <he****@hotpop.com> wrote in message news:<c2*************@ID-203069.news.uni-berlin.de>...
something like http://www.example.com/banner.php in the URL?


no, like http://swd.localhost/pj.php?page=banner
Iam using GET here as well

how?
by going to http://www.example.com/index.php?style=master

it still works same way as before... when I have changet style I can
surf with it in all othet pages, but if I cnage style again I ll get
into index page..


It seems you are *always* going to
http://swd.localhost/pj.php
and use parameters to specify the page and style

So http://swd.localhost/pj.php?page=banner shows the banner page in
the previously selected style

http://swd.localhost/pj.php?style=gold changes style to "gold" and
shows what page? ???

http://swd.localhost/pj.php?page=banner&style=silver would (I
guess) show the banner page in the "silver" style


you are absolutly right... but Iam to stupid to manage to work it...
so how do I do it?
Jul 17 '05 #8
carramba wrote:
Pedro Graca <he****@hotpop.com> wrote in message news:<c2*************@ID-203069.news.uni-berlin.de>...
It seems you are *always* going to
http://swd.localhost/pj.php
and use parameters to specify the page and style

So http://swd.localhost/pj.php?page=banner shows the banner page in
the previously selected style

http://swd.localhost/pj.php?style=gold changes style to "gold" and
shows what page? ???

http://swd.localhost/pj.php?page=banner&style=silver would (I
guess) show the banner page in the "silver" style


you are absolutly right... but Iam to stupid to manage to work it...
so how do I do it?


The same way you keep the style when changing pages, is what you have to
do for pages when changing the style.
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #9

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

Similar topics

5
by: lawrence | last post by:
When users enter urls or other long strings it can destroy the formatting of a page. A long url, posted in a comment, can cause page distortions that make the page unreadable, till the website...
0
by: Anthony Baxter | last post by:
To go along with the 2.4a3 release, here's an updated version of the decorator PEP. It describes the state of decorators as they are in 2.4a3. PEP: 318 Title: Decorators for Functions and...
4
by: Danny | last post by:
Hi I don't understand why I keep getting "Error: Object expected" I tried different things and haven't been able to solve it. I'm a newbie so I'm not sure what I'm doing wrong. The debugger breaks...
2
by: Chuck Martin | last post by:
I am having a most frustrating problem that references, web searches, and other resources are no help so far in solving. Basically, I'm trying to design a pop-up window to be called with a funciton...
388
by: maniac | last post by:
Hey guys, I'm new here, just a simple question. I'm learning to Program in C, and I was recommended a book called, "Mastering C Pointers", just asking if any of you have read it, and if it's...
48
by: Frederick Gotham | last post by:
The "toupper" function takes an int as an argument. That's not too irrational given that a character literal is of type "int" in C. (Although why it isn't of type "char" escapes me... ) The...
14
by: ghostwalker | last post by:
Hi I have an HTML form with a textarea on it. When submitted (using 'get' not 'post') this forms action php file simply does this to retrieve the values: $message = $_GET; Now it all works...
13
by: Boris | last post by:
Can anyone tell me if Opera 9.5 is behaving correctly when wrapping the word C++, eg: C+ + Opera 9.2 didn't wrap C++. For those who use Opera 9.5 there is a test case at...
3
by: bollweevil | last post by:
Hello Everyone, I do Django web development on my Mac at home, and then I rsync the files with the Ubuntu web server. I want to write one single bash shell script that rsyncs the files and...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.