Re: Writing my own web based user forum

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<?php
#User authentication should not be a problem at all.
#If you want it simple just serialize a user class and write it to a
file or into a DB.

class user {
 var $username;
 var $pw;
 function set_user($name, $pw) {
  $this->pw = md5($pw);
  $this->username = $name;
  return true;
 }
}

$new_user = new user();
if ($new_user->set_user('Joe', 'swordfish') {
 $fp =@ fopen('/some_dir/users.txt', 'a');
 @fwrite($fp, serialize($new_user));
 @fclose($fp);
}

# the next time you need it simple read it in again with unserialize()

?>
On Fri, Aug 1, 2008 at 1:49 PM, Jason Pruim <japruim@xxxxxxxxxx> wrote:
> Hi Everyone,
>
> I am looking at writing my own web based user forum somewhat for my own
> knowledge, and because I know that I don't know enough to be able to tie in
> authentication so they only need 1 user account.
>
> Does anyone have any examples short of downloading something like phpbb and
> tearing it apart?
>
> It will probably be really light weight, basic forum that hopefully will
> expand into more as time goes on :)
>
> I've tried searching the web but have not been able to turn up any help
> unless I was to write a bridge for a song...
>
> Any knowledge you can bestow upon me is greatly appreciated!
>
> Thanks!
>
>
> --
>
> Jason Pruim
> Raoset Inc.
> Technology Manager
> MQC Specialist
> 11287 James St
> Holland, MI 49424
> www.raoset.com
> japruim@xxxxxxxxxx
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux