1 (edited by generalandrew 2006-12-03 00:34)

Topic: Make it to Redirect to a Diff. page if login is Right??????

Ok, so I'm building a website that has two parts: a static website with punbb forums and a separate member's area. Now my problem is that I want only certain users in a certain user group can access this members only area. I don't want to use a CMS because I want the challenge of constructing my own system, but this is the only part I find really difficult and will need help writing (if anyone is willing to offer, sadly I don't have any payment options though).

Now I was thinking that I would paste the snippet of PHP code and if it's correct, have it redirect to the member's area URL or return an error if the PHP code can't find their user name/password/group ID. I've looked a little bit at the login.php but it doesn't search for the correct group ID. If anyone is willing to construct this code or help me out I'd greatly appreciate it.

Thanks for reading!

Re: Make it to Redirect to a Diff. page if login is Right??????

Have you seen this? http://punbb.org/docs/dev.html#integration

You could then simply use an if statement that checks against $pun_user['g_id'].

Looking for a certain modification for your forum? Please take a look here before posting.

Re: Make it to Redirect to a Diff. page if login is Right??????

Hey, thanks a lot for that! I'll have to read it over more and see how it works.

Re: Make it to Redirect to a Diff. page if login is Right??????

After reading some books and thinking of ways I need some more help with this. My original idea was going to create a form and assign those forms as values to variables. The password box would be $userpassword and the login would be $userlogin and I need to think of an if statement on how to cross reference the input with what's stored in the punbb database, so that if $userpassword and $userlogin don't equal what's in the punbb, it returns an error, or if it does, there's a redirect to the member's area page. If that made any sense.

OR.....

Would it be easier to copy login.php and some how change or add a redirect if the if statement is true?

Re: Make it to Redirect to a Diff. page if login is Right??????

Sorry to once again not answer your question, but what is the trouble with using PunBB's integration capability (it's fine if you don't want / can't use it, but really I don't see now why it would be a problem, and I'll be able to help you better if you explain).

Looking for a certain modification for your forum? Please take a look here before posting.

Re: Make it to Redirect to a Diff. page if login is Right??????

Ok, let me start over because I'm starting to confuse my self as well lol. When you say integration, I think of having users being able to login without actually having to be at the forums (like having a text box to entre your user name/password in your index page of your website). Since I'm still kind of new at this, maybe that perception is wrong. Anyway, I want to create a whole different portal on my website- a downloads/web email hub BUT I only want people who have correct logins on PunBB to use it and to gain entrance into it.

So for that to work, I would have to cross check their input with what's in the database and if it's correct, re-direct to the downloads/email hub.

^^^^Now that's how I was thinking on doing it. When you say integration, is there another way/method you were talking about?