I'm trying to make a login button on my website, that allows users to login/register for the forums, via the home page of my website. I am hosting the forum on my own website, and MySQL host. I pretty much want to use the fluxbb login/register for everything on my website. Would that be possible? Could I make it so that users can login, and then comment on different places through my website? If so, then how? I'm kind of new to PHP, so as much as possible would be the best.
Offline
If what you mean by commenting on pages is a guestbook, there are plenty of free plugins and scripts on the internet.
Offline
If you know enough PHP you could just write a custom one.
Offline
ProgramCAT wrote:
If you know enough PHP you could just write a custom one.
That's what my problem is. This is only, like me second time with PHP. I know HTML, and a bit of CSS, and that's it. I've used it many times, just not my self.
Offline
If you look at the login code for FluxBB you could just copy it and use the same system for keeping the login session.
Offline
Magnie wrote:
If you look at the login code for FluxBB you could just copy it and use the same system for keeping the login session.
I tried, but maybe I was doing it wrong. I went into register.php, and copied the text in the file, and then I made a new file, and called it register.php, and then I went to it, and it was just white. I know it's not my computer being slow again, because the other register works. I think that maybe I need another file in the same directory as the register.php. Do I need the login, and logout.php as well?
Offline
trinary wrote:
You probably should add the other pages into the same directory. It would be helpful if you also posted the code for all the files.
The code would be too long for a post, and would take a very long time to upload all of the files. Google flubb, and click on the first link, and then click download. You can download the files and take a look, if you want. I also want the page to redirect to the homepage if possible. I was thinking of just making a link on the home page saying register, that links to the register.php page that works, but the thing is, after I register, it would redirect me to the forums but I want it to redirect to the home page when the link is pressed, BUT if the user clicks on register from the forums, it redirects them to the forums. To do that, I wanted to have two pages, but again, I don't know what code I need, and don't need, and what files I need or don't need.
Offline
elfin8er wrote:
Magnie wrote:
If you look at the login code for FluxBB you could just copy it and use the same system for keeping the login session.
I tried, but maybe I was doing it wrong. I went into register.php, and copied the text in the file, and then I made a new file, and called it register.php, and then I went to it, and it was just white. I know it's not my computer being slow again, because the other register works. I think that maybe I need another file in the same directory as the register.php. Do I need the login, and logout.php as well?
Yeah, the register.php copy probably needs to be in the same folder as the rest of the forums, or your need to change the PHP code so it imports/includes the files from the correct folder.
Cause there is probably something like: include("include/functions.php"); or include("include/config.php");
But if it's in another folder it'll try including a non-existent file.
Offline
Magnie wrote:
elfin8er wrote:
Magnie wrote:
If you look at the login code for FluxBB you could just copy it and use the same system for keeping the login session.
I tried, but maybe I was doing it wrong. I went into register.php, and copied the text in the file, and then I made a new file, and called it register.php, and then I went to it, and it was just white. I know it's not my computer being slow again, because the other register works. I think that maybe I need another file in the same directory as the register.php. Do I need the login, and logout.php as well?
Yeah, the register.php copy probably needs to be in the same folder as the rest of the forums, or your need to change the PHP code so it imports/includes the files from the correct folder.
Cause there is probably something like: include("include/functions.php"); or include("include/config.php");
But if it's in another folder it'll try including a non-existent file.
So you're saying that somewhere in the forms folder, there's a file called include/configuration.PHP?
Offline
I'm not entirely sure, but in the register.php, login.php, logout.php, etc, I am sure there are some lines of code saying: include("somefolder/somefile.php"); in each of the files. You want to change those to the corresponding folders. So if the default forum folder is /site/forums and the register.php is in /site/forums it is including the config file (for MySQL) from this folder/file: /site/forums/include/config.php. If you make a copy of register.php in the /site folder, then you need to change the include url from include/config.php to forums/include/config.php.
If you look at the first 100 lines of code, I'm sure you'll see an include() function and understand a little more of what I mean.
Offline