PEAR Packages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPEAR Packages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old May 25th, 2006, 05:15 AM
yust yust is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 1 yust User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
session variable problem in HTML_QuichForm

Hi, I one newer for PHP. During my coding with "HTML_QuichForm", I encountered one sesssion problem. My source code are as below:

In file "log.in", I added two elements "username" and "password", and create one SESSION variable 'username':
php Code:
Original - php Code
  1.  
  2. <?php
  3.         require_once 'HTML/QuickForm.php';
  4.         session_start();
  5.         $form = new HTML_QuickFrom('loginform', 'POST', 'main.php');
  6.         $form->addElement('header', null, 'QuickForm test');
  7.         $form->addElement('text', 'username', 'Enter your name:');
  8.         $form->addElement('password', 'password', 'Enter your password:');
  9.  
  10.         if ($form->validate())
  11.         {
  12.                 $form->process('login');
  13.         }
  14.         else
  15.         {
  16.                 $form->display();
  17.         }
  18.         function login($data)
  19.         {
  20.                 $_SESSION['username'] = $data['username'];
  21.         }
  22. ?>


In the file "main.php", I want to print the SESSION variable 'username':
php Code:
Original - php Code
  1.  
  2. <?php
  3.         session_start();
  4.         echo $_SESSION['username'];
  5. ?>


But in the file "main.php", the compiler always reported as below:
"Undefined variable: _SESSION"

Note, I have tested that SESSION works in other cases.

Thanks in advance!
Yu

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPEAR Packages > session variable problem in HTML_QuichForm


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway