Page 4 of 5

Re:Message Board in PHP with MySQL

Posted: Sat May 01, 2004 7:43 am
by AGI1122
Well there is 2 main ways in PHP cookies, or sessions. Although there is other methods you could devise if you know what your doing.

http://us2.php.net/manual/en/function.setcookie.php This is info on how to use setcookie(); use this function to either set a cookie or delete a cookie. If you want a specific example of using it just ask.

Re:Message Board in PHP with MySQL

Posted: Sat May 01, 2004 7:54 am
by Candy
Chris Cromer wrote: Well there is 2 main ways in PHP cookies, or sessions. Although there is other methods you could devise if you know what your doing.

http://us2.php.net/manual/en/function.setcookie.php This is info on how to use setcookie(); use this function to either set a cookie or delete a cookie. If you want a specific example of using it just ask.
Please do note that sessions are the php nice-ness layer on top of cookies, so effectively, you always use cookies in this way.

You can log an IP as being some user, and treat all unlogged IP's as not logged in.

Re:Message Board in PHP with MySQL

Posted: Sat May 01, 2004 8:15 am
by AGI1122
Please do note that sessions are the php nice-ness layer on top of cookies, so effectively, you always use cookies in this way.
Actually, PHP sessions uses 2 different methods, it can store the session id in the url OR a cookie. So even if cookies are off it will work by having the id in the url... but if cookies are on then it won't need to use the sessions in the url.
You can log an IP as being some user, and treat all unlogged IP's as not logged in.
That won't work for people with random ip's.

Re:Message Board in PHP with MySQL

Posted: Sat May 01, 2004 8:37 am
by DennisCGc
Hmm, I heard from other people, that work with PHP, that I have to include:

Code: Select all

<? session-start ?>
at the start of each page that wants to use cookies.
Is that correct ?

Re:Message Board in PHP with MySQL

Posted: Sat May 01, 2004 9:14 am
by Candy
DennisCGc wrote: Hmm, I heard from other people, that work with PHP, that I have to include:

Code: Select all

<? session-start ?>
at the start of each page that wants to use cookies.
Is that correct ?
Why don't you check the _FREE_ php manual pages about that? They include some info on those functions.
That won't work for people with random ip's.
Most notably not with NAT setups.



Note that you can disable putting session ID's in urls, thereby increasing the security slightly (not much, just capture the cookie). It does prevent logging the session id's on your computer.

Re:Message Board in PHP with MySQL

Posted: Sat May 01, 2004 9:27 am
by AGI1122
Actually it should be this:

Code: Select all

<?php session_start(); ?>
But that's only if you want to use sessions, not cookies. :P

Re:Message Board in PHP with MySQL

Posted: Tue May 04, 2004 11:14 am
by Neo
I was testing out the SMF (YaBBSE ) and was going through it. Thats why no questions so far. Its really good. I will be back with a lot more questions later.
Anway is there a special field type for passwords in MySQL

Re:Message Board in PHP with MySQL

Posted: Tue May 04, 2004 12:57 pm
by AGI1122
Well you just need to create a field type that is large enough to store the maximum length of the passwords... if you use md5 for instance a varchar with a 32 byte length would work since all the hashes from md5 are 32 bytes long.

And yeah, SMF is awsome(although I am biased because I worked on YaBBSE... and am part of the SMF mod development team) it's a shame the mega-tokyo forum can't be upgraded to SMF though because it requires PHP 4.1.0... and this site is running an older version of PHP than 4.1.0.

Re:Message Board in PHP with MySQL

Posted: Thu May 06, 2004 11:27 am
by Neo
What about upgrading PHP?

Re:Message Board in PHP with MySQL

Posted: Thu May 06, 2004 12:48 pm
by AGI1122
He doesn't have access to upgrade PHP... and his host won't upgrade it.

Re:Message Board in PHP with MySQL

Posted: Thu May 06, 2004 11:38 pm
by Embrance
heres a GOOD FlatFile board:
http://pblang.drmartinus.de/

Re:Message Board in PHP with MySQL

Posted: Fri May 07, 2004 6:51 am
by AGI1122
Nobody is looking for a flatfile board. This is about PHP/MySQL message boards. :P

Re:Message Board in PHP with MySQL

Posted: Fri May 07, 2004 10:13 am
by Embrance
At the beggining of the topic there wwas a disc. about it.i would post it there,nut i was kinda late... :P

Re:Message Board in PHP with MySQL

Posted: Fri May 07, 2004 2:14 pm
by AGI1122
He didn't ask for a flatfile board. He asked if it was better to store data in flatfiles or a database(MySQL) he is creating a message board, not looking for one. You should read it more thouroughly. ;)

Anyway, if he had asked for a flatfile bulletin board, I would have already chimed in and told him about the original YaBB which is flatfile. ;)

Re:Message Board in PHP with MySQL

Posted: Sun May 09, 2004 2:12 pm
by Neo
This is a sort of the end of the line (sigh) ;) for my project. I've started modifying the existing board software instead of writing the thing from scratch. Its more fun modifying :) it and their is more professional anyway. I will be popping it up now and then when I've got another related doubt or idea.
So I'm off to try something else...(presumably web related I'm thinking of Java)
Thanks Chris for all your help so far. :)