473,385 Members | 1,312 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,385 software developers and data experts.

session problem in php

i have written a login form but
now my welcome page displays error

Notice: Undefined variable: session in C:\xampp\htdocs\signup-login\welcome.php on line 18

welcome.php

Expand|Select|Wrap|Line Numbers
  1. <?
  2.  
  3. include "include/session.php";
  4. ?>
  5. <!doctype html public "-//w3c//dtd html 3.2//en">
  6.  
  7. <html>
  8.  
  9. <head>
  10.  
  11.  
  12. <meta name="GENERATOR" content="Arachnophilia 4.0">
  13. <meta name="FORMATTER" content="Arachnophilia 4.0">
  14. </head>
  15.  
  16. <body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
  17. <?
  18. echo "<center><font face='Verdana' size='2' >Welcome userid=$session[userid]<br><br></font>";
  19.  
  20. ?>
  21.  
  22.  
  23. </body>
  24.  
  25. </html>
  26.  
  27.  
my problem lies here
Welcome userid=$session[userid]
Mar 13 '13 #1
4 1659
r035198x
13,262 8TB
What is in session.php?

Did you try

Expand|Select|Wrap|Line Numbers
  1. <?php session_start(); ?>
at the start of the page?
Also if we are talking about the PHP session then I'd expect the syntax to be $_SESSION['userid']
Mar 14 '13 #2
The error says Notice: Undefined variable: session in C:\xampp\htdocs\signup-login\welcome.php on line 18.
please how do i define variable session

thank u
Mar 14 '13 #3
r035198x
13,262 8TB
Did you read my reply at all?
Mar 15 '13 #4
yes but the error persisted displaying
Undefined variable: session
i we need to define variable session
Mar 15 '13 #5

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

Similar topics

2
by: Damien | last post by:
Hi to all, I'm currently re-designing our intranet : nice and lean CSS2, cleaned-up PHP 4.3.7, better-normalized MySQL ;o). So I've started using the $_SESSION variable instead of register_globals...
1
by: pintur | last post by:
The message is: SQL1036C Errore di I/O durante l' accesso al database. SQLSTATE=58030 what is the proble? what for restore tables? thanks
3
by: TruongLapVi | last post by:
Hi I am using Forms Authentiaction. In Login Page, after authenticate, I read from database some info and save them into session. I set session time out 1 minutes, after that time, session...
0
by: joseph conrad | last post by:
Hi, I tried to implement my own session handler in order to keep control on the process the drawback I foun it is not creating and storing in my cookie the PHPSESSID variable anymore. reading te...
14
by: aroraamit81 | last post by:
Hi, I am facing a trouble. I have some Session variables in my code and somehow my session variables are getting mixed up with other users. For example User A has access to 10 companies and...
7
by: aroraamit81 | last post by:
Well Guys, Here is a very strange trouble. When more than one users request tto same page at the same time then our session gets conflicted. Moreover I printed my SessionID, strangely but true I...
1
by: Santosh | last post by:
Dear All i am writting a code sending mail with attachement. i am writting code for sending mail in one page and code for attaching a file in the next page. aftet attaching a file i am taking...
2
windows_mss
by: windows_mss | last post by:
hi Programmers, In course of my project now i facing an proble that i have to Redirect the page to some other Page after the Default Session Time Expire <sessionState ...
5
by: lyealain | last post by:
<% If Session("username") = "" Then Response.Redirect("/CLS/Login.asp") End If Dim conn Dim connectstr Dim db_name, db_username, db_userpassword Dim db_server Dim res
2
by: saketmayur | last post by:
Hi , I have write the following code to open word document on server using Microsoft.Office.Interop.Word; string DocPath = System.Configuration.ConfigurationManager.AppSettings; ...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.