473,320 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

session management

i have two programmes

FORM.PHP
Expand|Select|Wrap|Line Numbers
  1. <?PHP
  2. session_start();
  3. ?>
  4. <html>
  5. <body>
  6. <form action="welcome.php" method="post">
  7. firstname: <input type="text" name="fname" />
  8. <input type="submit" />
  9. </form>
  10.  
  11. </body>
  12. </html>
  13.  
WELCOME.PHP
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. session_start();
  3.  
  4. if($_COOKIE[' PHPSESSID']=$_SESSION['PHPSESSID'])
  5. {
  6.  echo  $_POST["fname"];
  7. }
  8. else
  9. {
  10. echo"wrong session id";
  11. }
  12. ?>
  13.  
but it gives me output wrong session id.
Expand|Select|Wrap|Line Numbers
  1. ($_COOKIE[' PHPSESSID']=$_SESSION['PHPSESSID'])
i want to know whether this is a true condition or not , kindly inform if any syntactical error in it
Oct 8 '10 #1
2 1137
dlite922
1,584 Expert 1GB
First of all you have a space in the cookie name.

Second you're not doing a comparison, you're doing an assignment with a single equal sign. To compare the two and return true or false you need two (2) equal signs.

This will test if the value of $foo equals the value of $bar:

$bar == $foo

This will put the value of $foo in to $bar so that they they contain the same value:

$bar = $foo

Let us know if that fixed it,



Dan
Oct 8 '10 #2
thanx sir
u solved my problem ....
Oct 12 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Magnus Warker | last post by:
Hi, after searching the web without finding what I'm looking for, I ask for help in this group. I would like to use phplib for authentication and session management. What I need, is a minimal...
3
by: Jeff | last post by:
We're running a fairly busy and complex e-commerce website. It's an online retailer. We utilize MySQL for most of our site-based dynamic data, and then we use Oracle to access inventory and place...
2
by: Ajay Brar | last post by:
hi! I am trying to implement session management similar to what PHP does by having a temp file with session information and storing the filename(which is just a random string) as a cookie on the...
1
by: Saradhi | last post by:
Is there any differenc ein the way ASP handles the Session management in Windows 2000 server with IIS 5.0 and 2003 Server with IIS 6.0? Did anything changed with respect to the Cookie Management? ...
4
by: Jay | last post by:
Hello, Is it possible to have session management differentiate within browsers on one pc? For example, if you have two browsers on the same shopping site, and one browser adds to the cart, the...
5
by: Abhilash.k.m | last post by:
This is regarding the session management using Out of proc session management(SQL SERVER). Among the samples below which one is better to set the session? 1. There are 20 session...
0
by: Toro | last post by:
Hi, I have found some information about a potential security flaw in cookieless session management. I am sure that the issue is well known to the community because it was reported over 2 years...
3
by: vikram | last post by:
I am using below mention code in a web usercontrol for session management for hastable objects. Code works sometime and sometime it doesnt work. Is there some problme in code: Private Sub...
1
by: ReinaldoCL | last post by:
Hello, I'm looking for a posibility to use session objects or cookies in a C# program on Pocket PC, that use a web service method with session enabled property. But the .NET Compact Framework...
2
by: satisharas | last post by:
Hello, I am trying to write a custom session manager in ASP.NET 2.0 using oracle as the backend. I want to know how the session expires in web garden and we are using NLB (a session can be...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.