HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
cookies - write & read by different php scripts
Post new topic   Reply to topic    HTML Help Forum Index -> PHP
View previous topic :: View next topic  
Author Message
PJ



Joined: 27 Jan 2007
Posts: 3
Location: Slovakia

PostPosted: Sun Feb 04, 2007 11:32 am     cookies - write & read by different php scripts Reply with quote

Hi, hope somebody can help me.... Shocked

I am trying to create a login system on my page. I have a page "login.php" - this is a user manager where I can create user's - the user name I also store as a cookie on clients computer. Then I have different pages (like guestbook.php, fotogalery.php) - here I just need to read a cookie with a user name on the client computer. And this is my problem...

I am able to write the cookie with the "loign.php" page, and I am also able to read it with "loign.php". But if I am trying to read a cookie with a different page (guestbook.php, fotogalery.php) this is not working. I tried to make some tests to write and read a cookie from different php pages and it is working but if I implement the read script into a existing page it does not work anymore. Also if I move the test page for reading to a different folder it stops working.

I found something about setrawcookie, this should be able to write a cookie without urlencoded cookie value. But how to write a cookie without urlencoded cookie name - that is (I think Sad ) my problem, that the cookie is url dependend.

(I hope a question like this is not in the forum somewhere - I was searching and did not succed Confused )

Thanks....PJ
coberr



Joined: 28 Feb 2007
Posts: 29

PostPosted: Wed Feb 28, 2007 12:10 pm     Reply with quote

Just a suggestion...

Why don´t you use sessions instead of cookies?
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> PHP All times are GMT - 8 Hours
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
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial