Google Community Chat
 
members only

You're visiting Google Community as a guest.
In order to post, you'll need to register and log in.



(If you were registered and logged in, these advertisements wouldn't be here)
Post new topic   Reply to topic    Google Community Forum Index // Web Design, Coding & Programming Forum
   
Author Message
pleasant
Senior Googler
Senior Googler


Joined: 31 Jul 2004
Location: australia
1094.80 GC$

Items

PostPosted: Thu Sep 30, 2004 8:51 pm    Post subject: members only Reply with quote
how can i amke a page so only logged in people can view it?
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Ashes
Senior Googler
Senior Googler


Joined: 26 Sep 2004
Location: Bosom of Dixie
1601.05 GC$

Items

PostPosted: Thu Sep 30, 2004 9:47 pm    Post subject: Reply with quote
Assign a cookie when the person logs in, and then check that cookie's contents when they view the page.

If the user has the cookie, with the right content (password, username, whatever), then they can view the page.

If not, they get served with a page asking them to log in.
_________________
This is a sig. Isn't it nice?
pushing through [dot] com
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger ICQ Number
cvrk3
Google Guru
Google Guru


Joined: 05 Jul 2004
Location: India
16443.40 GC$

Items

PostPosted: Thu Sep 30, 2004 10:50 pm    Post subject: Reply with quote
ashes, i forgot i posted a message of welcome to earlier Embarassed Your posts are of quality, informative and also enjoyable!! keep it up and you have the ability to get to 10000 posts earlier than me. All the best Laughing
Back to top
View user's profile Send private message
Ashes
Senior Googler
Senior Googler


Joined: 26 Sep 2004
Location: Bosom of Dixie
1601.05 GC$

Items

PostPosted: Thu Sep 30, 2004 10:51 pm    Post subject: Reply with quote
Thank you so much. :)

Additionally I forgot to mention that if you don't want to use cookies, you can also do it with php sessions.
_________________
This is a sig. Isn't it nice?
pushing through [dot] com
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger ICQ Number
pleasant
Senior Googler
Senior Googler


Joined: 31 Jul 2004
Location: australia
1094.80 GC$

Items

PostPosted: Thu Sep 30, 2004 11:59 pm    Post subject: Reply with quote
im asking how do i do it like the code to put on the page
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Eric
Better than you
Google Guru


Joined: 12 Aug 2004
Location: Toronto, Ontario, Canada.
2491.35 GC$

Items

PostPosted: Fri Oct 01, 2004 12:01 am    Post subject: I think I have a solution... Reply with quote
Well, how you will get the cookie writing to work, you decide, but you can write cookies in the following way:-
Code:
<?PHP
  setcookie("username",$name);
?>

And you can read them using this code:
Code:
<?PHP
  $_COOKIE['username'];
?>

Well you can use the $_COOKIE to display pages only to logged on members like this:
Code:
<?PHP
  if(isset($_COOKIE['username'])
  {
  include "./members.html";
  }
  else
  {
  echo "Sorry you are not logged on!";
  }
?>

Sorry if there are any errors, I just wrote it in a hurry without testing...
_________________
"A lie gets halfway around the world before the truth has a chance to get it's pants on." - Winston Churchill


Last edited by Eric on Fri Oct 01, 2004 8:59 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Ashes
Senior Googler
Senior Googler


Joined: 26 Sep 2004
Location: Bosom of Dixie
1601.05 GC$

Items

PostPosted: Fri Oct 01, 2004 10:14 am    Post subject: Reply with quote
We really shouldn't be coding for you. I'd be glad to help you work out your code and find and fix errors, but I won't write it for you.

If this is something you want to use, then you should either learn the technology or hire someone to do it for you.

If you'd like to learn, then this is the documentation for setcookie.
_________________
This is a sig. Isn't it nice?
pushing through [dot] com
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger ICQ Number
Sponsored Links
Posted: 5 Dec 2008 9:06 am    Post subject: Advertisements
Back to top
Post new topic   Reply to topic    Google Community Forum Index // Web Design, Coding & Programming Forum 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
Host your free forums with Invision Plus.net forum web hosting with your own subdomain.

alexisBlue v1.2 // Theme Created By: Andrew Charron // Icons in Part By: Travis Carden

© 2005-2006 Google Community

Powered by phpBB

Privacy Policy | Contact Us

Powered by Google Search blog

This website is not affiliated in any way with Google, Inc.
Google™ is a registered trademark of Google, Inc.