Loging out with Cookies

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
datwig
-


Joined: 26 Jan 2003
Posts: 85

PostPosted: Wed Apr 23, 2003 11:11 pm    Post subject: Loging out with Cookies Reply with quote

How do I create a "Logout" Script when I set you logged in with cookies. I tried
Code:
setcookie("username", "");
setcookie("password", "");

But it gives me Error 200. What do I do?
Back to top View user's profile Send private message AIM Address
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Thu Apr 24, 2003 12:12 pm    Post subject: Re: Loging out with Cookies Reply with quote

datwig wrote:
How do I create a "Logout" Script when I set you logged in with cookies. I tried
Code:
setcookie("username", "");
setcookie("password", "");

But it gives me Error 200. What do I do?

Error 200 means that the script run OK but that it sent nothing to the web server. So add an echo "OK" there and all would be fine.
Try to do a search on the forum for error 200 for more information.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
datwig
-


Joined: 26 Jan 2003
Posts: 85

PostPosted: Thu Apr 24, 2003 8:42 pm    Post subject: Reply with quote

Man, that Error 200 thing is anoying.

Anyway, can you teach me how to create a blank directory (an empty folder)?
Back to top View user's profile Send private message AIM Address
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Apr 25, 2003 2:38 pm    Post subject: Reply with quote

datwig wrote:
Man, that Error 200 thing is anoying.

Anyway, can you teach me how to create a blank directory (an empty folder)?

Blank directory??? Sorry, but can you explain what you mean exactly?
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
datwig
-


Joined: 26 Jan 2003
Posts: 85

PostPosted: Fri Apr 25, 2003 4:48 pm    Post subject: Reply with quote

Problem:
Using mkdir("path"); to make an empty folder. I want to do it so if the folder doesn't exist, then create it. I used the following code.
Code:
if (opendir("./folder") == false) {
    mkdir("./folder");
}
But when the directory doesn't exist, it gives an error and then creates the directory.

How I solved it:
I looked in a PHP book I bought (SAMS teach yourself PHP in 24 hours) and I saw a is_dir() function. Although it didn't give any information about using is_dir(), I assumed it would be like isset() so I tried it out and came up with:
Code:
if (is_dir("./folder") == false) {
    mkdir("./folder");
}
And now it works fine.
Back to top View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group