Passing Values To All Pages

windows

Guest
Here my problem...<br />
<br />
I create tooooo many different layouts and I change my site all the time and I always here people telling me that I should've kept my old layout. Well, what I am doing is I am making a layout selecter. Which the index page of my site is a simple HTML form that passes which ever layout to the home page and reads the value using PHP. I didn't post this under the PHP topic becuase I feel this has more to do with HTML forms. <br />
<br />
Basically, I use PHP to say if(layout == 1) { load this stylesheet }, but I have a problem, I don't know which page the user will click on next (like links in my menu) so I don't know how to keep passing the user's layout value along to each page they visit? <br />
<br />
I know I can use JS, but not everyone has it enabled, unlike with forms and PHP...<br />
<br />
Any help? I'm sure Pyro will respond! :D <br />
Thanks upfront...<!--content-->Use the session or a query string. I do not know how to load something as a session variable, but I would use that so it could affect all of your pages (until the session runs out, I know in asp and asp.net that is a 20 minuit time span). You can also just have them select it in a members only area and have it stored in a data base. But then they would have to login. It would be like that mymsn or myyahoo or whatever.<!--content-->Is there any other way to do it? I thought of setting a cookie, but I didn't know if there was something else I could do without the cookie, or sessions because I don't want people to have to login. The only people who go to my site are kids at school and they won't feel like doing all of that. Thank you though. Anybody else have ideas?<!--content-->They do not have to login to use a session, the session is unique to that user for a period of time. You can use a cookie if it makes you happy, its just my preference not to use them. They do not have to login with a cookie either. The only problem is, depending on the session length (session can be done with cookies actually) they will have to reselect the layout. Besides cookie and session you are not left with many options.<!--content-->Oh I see! Thank you, Well, not everyone has cookies enabled so I will use a session. I guess I can set the session for an hour or so, but have an option to be able to change your layout under my menu. Thanks again for your help!<!--content-->It isn't always obvious but sessions will usually require cookies to be on to work. In fact the only two ways I know to support sessions is cookies and URL rewriting (i.e. in a query string) but the latter is really a hassle by comparison.<br />
<br />
What I'm trying to say is you can't just "do sessions" on the server; you have to have something on the client that the client sends with each request to act as a "key" to the session data stored on the server.<!--content-->well in asp.net it is cookies by default, if the user does not support them the url is parsed auto. No extra codeing. You can also use the viewstate (I think), but that is gay lol. I do not use viewstate for really anything because it an annoyance. The viewstate is an encrypted hidden input, it can checked for corruption and other sutff, but I just do not like it because it has limits on what you can store. session cookies are a bit more versitile.<!--content-->
 
Back
Top