Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 07-29-2004, 12:15 PM   #1 (permalink)
apoola
Registered User
 
Join Date: Jul 2004
Posts: 7
apoola is on a distinguished road
Please help

I am new to mysql,php. The code was working fine until suddenly I started getting this message. Can anyone help, what this exactly means
..............

Warning: session_start(): open(/tmp/p/o/o/poola.com/sess_e1e50f30f30ccc8443e7dfcbf841f6b9, O_RDWR) failed: Permission denied (13) in /home/content/a/p/o/apoola/html/poolaschool/login/checkuser.php on line 4

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/content/a/p/o/apoola/html/poolaschool/login/checkuser.php:4) in /home/content/a/p/o/apoola/html/poolaschool/login/checkuser.php on line 4

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/content/a/p/o/apoola/html/poolaschool/login/checkuser.php:4) in /home/content/a/p/o/apoola/html/poolaschool/login/checkuser.php on line 4
login successfulPlease login below!
apoola is offline   Reply With Quote
Old 07-29-2004, 12:17 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
post the first 10 lines of code please EXACTLY as they are in your script.

most likely you are printing either characters or white space to the browser before you call your session_start(). session_start() is a header function and needs to be called before anything is printed to the browser. ( even white space )
__________________
Mike
sde is offline   Reply With Quote
Old 07-29-2004, 12:23 PM   #3 (permalink)
apoola
Registered User
 
Join Date: Jul 2004
Posts: 7
apoola is on a distinguished road
heres the code

$familyusername = $_POST['username'];
$password = $_POST['password'];

if((!$familyusername) || (!$password)){
echo "Please enter ALL of the information! <br />";
include '../login/login_form.html';
exit();
}

// Convert password to md5 hash
$password = md5($password);

// check if the user info validates the db
$sql = mysql_query("SELECT * FROM users WHERE username='$familyusername' AND password='$password' AND activated='1'");
$login_check = mysql_num_rows($sql);

if($login_check > 0){
while($row = mysql_fetch_array($sql)){
foreach( $row AS $key => $val ){
$$key = stripslashes( $val );
}
// Register some session variables!
session_register('first_name');
$_SESSION['first_name'] = $first_name;
session_register('last_name');
$_SESSION['last_name'] = $last_name;
session_register('username');
$_SESSION['username'] = $familyusername;
session_register('email_address');
$_SESSION['email_address'] = $email_address;
session_register('special_user');
$_SESSION['user_level'] = $user_level;
apoola is offline   Reply With Quote
Old 07-29-2004, 12:24 PM   #4 (permalink)
apoola
Registered User
 
Join Date: Jul 2004
Posts: 7
apoola is on a distinguished road
Re: heres the very first lines i missed in the last

PHP Code:
<?
include 'db.php';

session_start();
if (!empty(
$_SESSION['username'])) {
    print 
"you are already logged in!";
    include 
'../family/displaytree.php';
    exit();
}

$familyusername $_POST['username'];
$password $_POST['password'];

if((!
$familyusername) || (!$password)){
    echo 
"Please enter ALL of the information! <br />";
    include 
'../login/login_form.html';
    exit();
}

// Convert password to md5 hash
$password md5($password);

// check if the user info validates the db
$sql mysql_query("SELECT * FROM users WHERE username='$familyusername' AND password='$password' AND activated='1'");
$login_check mysql_num_rows($sql);

if(
$login_check 0){
    while(
$row mysql_fetch_array($sql)){
    foreach( 
$row AS $key => $val ){
        $
$key stripslashes$val );
    }
        
// Register some session variables!
        
session_register('first_name');
        
$_SESSION['first_name'] = $first_name;
        
session_register('last_name');
        
$_SESSION['last_name'] = $last_name;
        
session_register('username');
        
$_SESSION['username'] = $familyusername;
        
session_register('email_address');
        
$_SESSION['email_address'] = $email_address;
        
session_register('special_user');
        
$_SESSION['user_level'] = $user_level;
apoola is offline   Reply With Quote
Old 07-29-2004, 12:30 PM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
have you messed with the permissions on your server lately? now that i look again, it seems as though php does not have permission to access the files in : /tmp/p/o/o/poola.com/
__________________
Mike
sde is offline   Reply With Quote
Old 07-29-2004, 12:37 PM   #6 (permalink)
apoola
Registered User
 
Join Date: Jul 2004
Posts: 7
apoola is on a distinguished road
Re: Re: heres the very first lines i missed in the last

not really, the server is not on my computer.
apoola is offline   Reply With Quote
Old 07-29-2004, 12:47 PM   #7 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
the admin probably screwed up the permissions then.

make a new file and just put this:
PHP Code:
<?
session_start
();
?>
save it as test.php and see if you get the same errors.

if you do, inform the admin of that server that they need to fix permissions so you can use sessions with php.
__________________
Mike
sde is offline   Reply With Quote
Old 07-29-2004, 12:49 PM   #8 (permalink)
apoola
Registered User
 
Join Date: Jul 2004
Posts: 7
apoola is on a distinguished road
sessions.start()

thanks.will try that and get back.
apoola is offline   Reply With Quote
Old 07-29-2004, 12:51 PM   #9 (permalink)
apoola
Registered User
 
Join Date: Jul 2004
Posts: 7
apoola is on a distinguished road
Re: sessions.start()

I still got the same kind of message


Warning: session_start(): open(/tmp/p/o/o/poola.com/sess_0aee863601e845c4fdc6d0cb203d3662, O_RDWR) failed: Permission denied (13) in /home/content/a/p/o/apoola/html/poolaschool/login/test.php on line 2

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/content/a/p/o/apoola/html/poolaschool/login/test.php:1) in /home/content/a/p/o/apoola/html/poolaschool/login/test.php on line 2

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/content/a/p/o/apoola/html/poolaschool/login/test.php:1) in /home/content/a/p/o/apoola/html/poolaschool/login/test.php on line 2

Warning: Unknown(): open(/tmp/p/o/o/poola.com/sess_0aee863601e845c4fdc6d0cb203d3662, O_RDWR) failed: Permission denied (13) in Unknown on line 0

Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0


apoola
apoola is offline   Reply With Quote
Old 07-29-2004, 01:23 PM   #10 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
yep. nothing wrong with that code whatsoever. contact that admin and tell him they messed something up.
__________________
Mike
sde is offline   Reply With Quote
Old 07-29-2004, 02:39 PM   #11 (permalink)
apoola
Registered User
 
Join Date: Jul 2004
Posts: 7
apoola is on a distinguished road
Thanks, for your help. Emailed them but get their reply.
apoola
apoola is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 07:19 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting