473,662 Members | 2,596 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sessions

20 New Member
Hi ,

I am back with another small problem:

I want to create a session in which i want to declare a session variable. I want to use the value of that session variable on the next two pages. This is the code that i have.
1st page:
Expand|Select|Wrap|Line Numbers
  1. <?PHP
  2. session_start();
  3. session_register ("demo");
  4. if($_SERVER['HTTP_REFERER'] == "http://localhost/FAO_test/firms_WEB/Untitled-6.php")
  5.   {
  6.   $test=1;
  7.   $_SESSION["demo"]= $test;
  8.   }
  9.   ?>
2nd page
Expand|Select|Wrap|Line Numbers
  1. <?PHP
  2. session_start();
  3. if ($_SESSION['demo']== 1)
  4.  include ("Untitled-7.php");
  5. ?>
3rd page
Expand|Select|Wrap|Line Numbers
  1. <?PHP
  2. session_start();
  3. if ($_SESSION['demo']== 1)
  4.  include ("Untitled-7.php");
  5. ?>
But the problem is that the value of demo is not registering and i dont think the if statement in the 2nd and 3rd page is working. It displays the UNtitled-7.php even if demos value is not 1.

Please tell me what i am doing wrong??
Apr 15 '08 #1
3 898
debasisdas
8,127 Recognized Expert Expert
Question moved to PHP forum.
Apr 16 '08 #2
TheServant
1,168 Recognized Expert Top Contributor
This has already been posted!!!
Apr 16 '08 #3
ronverdonk
4,258 Recognized Expert Specialist
This is a double post. Youi have been warned via PM not to do that! This thread will be closed.

moderator
Apr 16 '08 #4

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

Similar topics

2
2808
by: The Plankmeister | last post by:
Hi... I'm trying my hardest to understand fully how sessions work and how best to use them. However, all I can find is information that doesn't tell me anything other than that sessions store information between pages, which I knew already. I want to know HOW sessions work! If anybody has any good links to material that explains sessions fully, then please send those links this way! I'm particularly interested in the...
13
12036
by: jing_li | last post by:
Hi, you all, I am a newbee for php and I need your help. One of my coworker and I are both developing a webpage for our project using php. We have a copy of the same files in different location on the server (in our own accounts on the same machine). When I am testing both versions of our program using the same browser (IE on Windows or Konqueror on Linux) the session variables will mix up and only the latest selection or options will...
3
2463
by: Maxime Ducharme | last post by:
Hi group We have a problem with sessions in one of our sites. Sessions are used to store login info & some other infos (no objects are stored in sessions). We are using Windows 2000 Server (IIS 5.0) with ASP 3.0 (no .NET on this site). Sometime, data in session is emptied. I say "sometime"
3
3712
by: Will Woodhull | last post by:
Hi, I'm new here-- I've been reading the group for a couple of days. Nice group; I like the way n00b33 questions are handled. I've been using a Javascript routine in index.html to determine a visitor's browser's capabilities. The Javascript then calls main.php, passing back its findings with a GET string; main.php saves the data as a visitor's profile in $_SESSION elements. It then serves up home.html and any further pages requested...
2
2954
by: Steve Franks | last post by:
According to the docs you tell ASP.NET to use cookieless sessions by setting a value in the config.web file. However, what if I wanted to determine at run time whether or not I wanted to use cookieless sessions for a particular user, and if so, I'd instruct ASP.NET to turn on cookieless sessions for a particular user session. Is this possible? For example I want to use cookie based sessions by default for all users. But if a user has...
12
2277
by: D. Shane Fowlkes | last post by:
This is a repost (pasted below). Since my original post, I've double checked the system clock and set all IIS Session Timeout values to 10 minutes. Still ...the problem occurs. I've also installed Deep Metrix Live Stats 6.2 XPS just to make sure nothing really strange was going on was going on. Still....the sessions only increment...or should I say my counter in my asax file.... and never goes down. If it matters, this machine is...
6
3784
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for one day): \\FFDS24\ASP.NET Applications(_LM_W3SVC_1_Root_ATV2004)\Errors During Execution: 7 \\FFDS24\ASP.NET Apps v1.1.4322(_LM_W3SVC_1_Root_ATV2004)\Compilations
22
3159
by: magic_hat60622 | last post by:
Hi all. I've got an app that dumps a user id into a session after successful login. the login page is http://www.mydomain.com/login.php. If the user visits pages on my site without the www (i.e., http://mydomain.com/foo.php), the session works fine and login state is maintained. If he visits http://www.mydomain.com/foo.php, the app drops the logged-in state.
13
35943
Frinavale
by: Frinavale | last post by:
One of the most fundamental topics in web design is understanding how to pass information collected on one web page to another web page. There are many different ways you could do this: Cookies, Database... However, I'm going to cover how to use Sessions. Sessions are used to store information in order to use it during later page requests or in other web pages in a web application. By default Cookies are used to identify which session...
3
28226
Atli
by: Atli | last post by:
Introduction: Sessions are one of the simplest and more powerful tools in a web developers arsenal. This tool is invaluable in dynamic web page development and it is one of those things every developer needs to know how to use. This article explains the basics of PHP Sessions. Assumptions: Basic PHP knowledge is required (variables, arrays and such) HTML Forms. What are Sessions? Sessions are a way of storing data. When developing...
0
8432
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8344
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
8764
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
8546
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,...
1
6186
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5654
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
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1993
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1752
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.