Re: Writing my own web based user forum

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

 



If I fully understood the question you were asking then no.
Since it seems you are using a database there is no need to serialize.
You can write a simple function that fetches user data from a DB query
and then creates the object.
If you are going to use sessions you will have to do that only when
the user logs in and for verification purposes of whatever kind.
You might think of something similar to:
http://webbytedd.com/b1/simple-session/

In your original post you did not mention a "picture upload site" so I
suggest it is about uploading pictures to the forum/attaching them to
a thread.
I do not really have an idea of how your site will be operating, but I
guess you analyze the GET parameters and include files according to
them.
Some code might be helpful to explain what you want

On Fri, Aug 1, 2008 at 2:52 PM, Jason Pruim <japruim@xxxxxxxxxx> wrote:
> So are you suggesting, create the users in the forum, and then just
> serialize/unserialize when needed to store the info so when they go to the
> picture upload side it queries the forum database?
>
>
> On Aug 1, 2008, at 8:07 AM, Bernhard Kohl wrote:
>
>> <?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
>>
>>
>
> --
>
> 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


[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