473,651 Members | 2,663 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

$_GET & $_SESSION conflikt?

Hi!
Tahnx for taking time and reading!
This script should load default page and default stylesheet, but its
only loads default page, you have to actualy click on the style link
to load style...
but I dont understand why! It started when I "compresed" script and
addet $_GET['page'] in the same "if" set... but it shoudent by eny
problem...
*************** ***********
if (empty($_GET['style']) && ($_GET['page'])) {

if (!isset($_SESSI ON['stylesheet']) && !isset($_GET['page'])) {

$_SESSION['stylesheet'] = 'master';
}

} else {
$_SESSION['stylesheet'] = $_GET['style'];

$_GET['page'] = 'main';
}
$mainBODY = file_get_conten ts(str_replace( " ",
"%20",$_GET['page'].'.php'));
echo '<style type="text/css" media="all">@im port
"'.$_SESSIO N['stylesheet'].'.css";</style>';
*************** *************** ****
thanx for helping out

Carramba
Jul 17 '05 #1
2 3407
Find answers inline:

"carramba" <ca******@bootr e.com> wrote in message
news:a4******** *************** ***@posting.goo gle.com...
Hi!
Tahnx for taking time and reading!
This script should load default page and default stylesheet, but its
only loads default page, you have to actualy click on the style link
to load style...
but I dont understand why! It started when I "compresed" script and
addet $_GET['page'] in the same "if" set... but it shoudent by eny
problem...
*************** ***********
if (empty($_GET['style']) && ($_GET['page'])) {

if (!isset($_SESSI ON['stylesheet']) && !isset($_GET['page'])) {

$_SESSION['stylesheet'] = 'master';
}

} else {
$_SESSION['stylesheet'] = $_GET['style'];
/\/\/\
$_GET['style'] is not set, that's why default styleshit aint loading
i suppose it should read
$_SESSION['stylesheet'] = 'main';

$_GET['page'] = 'main';
}
$mainBODY = file_get_conten ts(str_replace( " ",
"%20",$_GET['page'].'.php'));
echo '<style type="text/css" media="all">@im port
"'.$_SESSIO N['stylesheet'].'.css";</style>';
*************** *************** ****
thanx for helping out

Carramba

Jul 17 '05 #2
"Dmitry Ruban" <di**@region35. ru> wrote in message news:<c2******* ****@gavrilo.mt u.ru>...
Find answers inline:

"carramba" <ca******@bootr e.com> wrote in message
news:a4******** *************** ***@posting.goo gle.com...
Hi!
Tahnx for taking time and reading!
This script should load default page and default stylesheet, but its
only loads default page, you have to actualy click on the style link
to load style...
but I dont understand why! It started when I "compresed" script and
addet $_GET['page'] in the same "if" set... but it shoudent by eny
problem...
*************** ***********
if (empty($_GET['style']) && ($_GET['page'])) {

if (!isset($_SESSI ON['stylesheet']) && !isset($_GET['page'])) {

$_SESSION['stylesheet'] = 'master';
}

} else {
$_SESSION['stylesheet'] = $_GET['style'];


/\/\/\
$_GET['style'] is not set, that's why default styleshit aint loading
i suppose it should read
$_SESSION['stylesheet'] = 'main';

Didin't I do it in if empty code line? Becouse if I run thouse
parameters separatly "style " and "page" they work, but to gether in
same "if" style's defaoult ll not load

$_SESSION['stylesheet'] = 'master'; <<= don't I set that if enpty load
master stylesheet here?
$_GET['page'] = 'main';
}
$mainBODY = file_get_conten ts(str_replace( " ",
"%20",$_GET['page'].'.php'));
echo '<style type="text/css" media="all">@im port
"'.$_SESSIO N['stylesheet'].'.css";</style>';
*************** *************** ****
thanx for helping out

Carramba

Jul 17 '05 #3

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

Similar topics

8
12684
by: Steve Fitzgerald | last post by:
The below login script does work. The form does not seem to be submitting. I keep getting the username and password fields. The only errors I get are notices that email and password and undefined indexes. Here's the login script: <?php session_start(); // includes
0
2589
by: Thomas Carcaud | last post by:
I read php manual many times but I can't figure out register_globals works. I m using Php 4.3.2 and register_globals on. It seems to have different effects on $_GET and $_SESSION. First with $_GET : <? echo $var."\n"; echo $_GET."\n"; $var="gna"; echo $var."\n"; echo $_GET."\n"; $_GET="gnou";
5
19114
by: gf | last post by:
I had a client recently contact me with a script that wasn't working. I quickly isolated the problem as to the fact that the $_GET array was not being made available to all scripts, even though register_globals was set to ON. The client then notified his host who seemed to know exactly the issue and we added these lines to the top of the script (this script is included in all other scripts) and it solved the problems: /* mp.net patch...
6
2212
by: | last post by:
I ask something relative later but the answer make me cry ;-) If we duplicate the browser window (both in IE / Mozilla), both of 2 browser windows use the same session!!! This produces many problems... My program is this: I have html format books inside zip files. If I choose a book from my main page, php sets $_SESSION = "a_book.zip"; and loads the index.html from a_book.zip. if we click a link inside index.html like:
7
11869
by: Dan | last post by:
I was trying to troubleshoot a login page that doesn't work - it keeps saying the login/password is missing - when my tracing discovered this peculiar behavior. register_globals is off, so at the top of my script I assign a few variables to incoming GET and POST values. $login = clean($_POST, 30); $passwd = clean($_POST, 30);
2
3124
by: keeps21 | last post by:
I have a script that recieves an id number via the address bar when a link is clicked. ie . index.php?id=1 if the link was for the story whose ID is 1. My script checks if a user is logged in, if not they are redirected to the login page. If logged in they may edit the story. I assign $_GET to $id.
5
2594
by: webgenius | last post by:
At present I'm using $_SESSION to create and store the login details. But I'm not able to access this session variable. Is there any way for the website to remember these details? $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "LoginOK.php" session_start(); session_register("myusername");...
8
5566
by: The KwikOne | last post by:
Since to have a page validate (HTML and XHTML) you should have your URL parameters separated by the appropriate separator. However, if an ampersand is used it needs to be expressed as &amp; (example: ./ index.php?a=1&amp;B=2). But, if that is done, then the _GET or _REQUEST array element names are incorrect. In the example the _GET array will be: _GET = 1 (instead of _GET = 1) and _GET = 2 (instead of _GET = 2). So, how do I get around this?...
17
1867
by: sheldonlg | last post by:
I need to do some modifications on some code I just inherited and that code has me baffled. On one page, caller.php, with method get there is an anchor with href="foo.php?bar=123". On foo.php, the URL shows the parameter. So far, so good. In foo.php there is no $_GET statement to decipher the value from bar. Furthermore, I did a grep of the entire code base for $_GET and for $_REQUEST and there was none. The code then proceeds to...
0
8352
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8697
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8465
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8579
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5612
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2699
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 we have to send another system
2
1587
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.