php/mysql login page.

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
vickriz
Forum Newbie
Posts: 5
Joined: Tue Aug 12, 2003 11:16 pm
Location: Phlippines
Contact:

php/mysql login page.

Post by vickriz »

good day to all.
i found a php/mysql code at hotscript ["SF-User V1.0"] and try using it. I have followed the direction how to configure it for my needs on database connection. but then i have encountered an error at first launch on my local server. this is the error:
Warning: open(/tmp\sess_7257e7515a0a4e88a9b268a169e074d0, O_RDWR) failed: No such file or directory (2) in c:\phpdev5\www\login\functions.php on line 2
Hello Guest!
Main | Login | Log Out | Register | Members

Powered by SF-Users V1.0
Warning: open(/tmp\sess_7257e7515a0a4e88a9b268a169e074d0, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
What doest this mean? please help, any suggestion or advice will appreciate it very much..

PS: i know there's no problem with the code it self but i post it anyway to make more easy.

Code: Select all

<?php
session_start(); //

##################################
# EDIT BELOW BUT ONLY BETWEEN '' #

$DBHost = 'localhost'; //Your host, usually localhost
$DBUser = 'admin'; //Your database username
$DBPass = 'administrator'; //Your database password
$DBName = 'members'; //The database name you want/have the user system on

# EDIT ABOVE BUT ONLY BETWEEN '' #
##################################

mysql_connect("$DBHost", "$DBUser", "$DBPass")or die(mysql_error()); 
mysql_select_db("$DBName")or die(mysql_error()); 
?>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You haven't set the path for sessions to a valid temporary directory.

Open your php.ini and set it. Remember to restart your web server software.
vickriz
Forum Newbie
Posts: 5
Joined: Tue Aug 12, 2003 11:16 pm
Location: Phlippines
Contact:

Post by vickriz »

feyd wrote:You haven't set the path for sessions to a valid temporary directory.

Open your php.ini and set it. Remember to restart your web server software.
what text im going to add inside my php.ini for sessions of temporary directory?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

the session.save_path directive, it's in the file already, just set to /tmp
vickriz
Forum Newbie
Posts: 5
Joined: Tue Aug 12, 2003 11:16 pm
Location: Phlippines
Contact:

Post by vickriz »

hi again thanks for rapid response.

the argument for my sessions in php.ini was there..
[Session]
; Handler used to store/retrieve data.
session.save_handler = files

; Argument passed to save_handler. In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this
; variable in order to use PHP's session functions.
session.save_path = /tmp

; Whether to use cookies.
session.use_cookies = 1


; Name of the session (used as cookie name).
session.name = PHPSESSID

; Initialize session on request startup.
session.auto_start = 0

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0

; The path for which the cookie is valid.
session.cookie_path = /

; The domain for which the cookie is valid.
session.cookie_domain =

; Handler used to serialize data. php is the standard serializer of PHP.
session.serialize_handler = php
how can i set this session /tmp in windows? can i assign other folder like "C:\phpdev\tmp"?

i have running phpdev5 as my apache web server.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

vickriz wrote:can i assign other folder like "C:\phpdev\tmp"?
yes, I answered that in my first post.
Post Reply