PDA

View Full Version : php registration


BBuchanan
02-07-2012, 07:37 AM
This has been edited to reflect the new setup. If something isn't working, please reply here or pm me.

This is only a registration and email verification system.

I have included a readme for this php script, but if you don't have fsdbase installed, then this system won't work.

Again, this is modified after user reports letting me know. This 'should' work out of the box and after reading the readme.

http://www.vmatsim.net/register.zip

BBuchanan
02-07-2012, 11:49 AM
Just a quick edit, in the readme:


ALTER TABLE `users` ADD `active` INT( 1 ) NOT NULL DEFAULT ('0');


should actually be:

ALTER TABLE `users` ADD `active` INT( 1 ) NOT NULL DEFAULT '0';

the whaler
02-24-2012, 03:41 PM
Hi Buchanan.

I was hoping to just use fsdbase itself for registering other pilots but that's not going to happen soon I think.
So I now tried your php script but I get a blank page after filling in the form and I also do not get a mail confirmation.

Can you check

http://fsdbase.servegame.com and see if you can help me correcting any errors?
I'm not sure there are logfiles I can check for this. If you know where to find these for php (ubuntu 11.10) than that might help me search myself.

Thanks Lex

BBuchanan
02-24-2012, 04:28 PM
Sorry form the late reply, im only in town and online on the weekends.

I couldnt find the register script

Most of the time, error log files are in tje same directory as the script unless the script or http conf says otherwise. Even the php.ini file has log location info in it.

the whaler
02-24-2012, 04:45 PM
Hi BBuchanan,

Well I think your quit quick as I asked this only 2 hours ago.

I think I might have found a problem.

PHP Fatal error: Call to undefined function mysql_connect() in /var/www/fsdbase/userreg/connect.php on line 8


Could the problem be in the fact I put the files in a subdirectory for fsdbase in stead of in the same directory? I did this because I was not sure I would use this php script in the future so wanted to be able to delete it easy (just the directory instead of individual files).
Thanks
Lex

BBuchanan
02-24-2012, 05:14 PM
Hi BBuchanan,

Well I think your quit quick as I asked this only 2 hours ago.

I think I might have found a problem.

PHP Fatal error: Call to undefined function mysql_connect() in /var/www/fsdbase/userreg/connect.php on line 8


Could the problem be in the fact I put the files in a subdirectory for fsdbase in stead of in the same directory? I did this because I was not sure I would use this php script in the future so wanted to be able to delete it easy (just the directory instead of individual files).
Thanks
Lex

Its meant to be seperate, so your fine. As long as you followed the readme file it should work. Could you give me:
Which are you using lighttp or apache
Php version

the whaler
02-24-2012, 05:21 PM
Apache2 2.20
PHP 5 (but I'm not sure on the rest)

the whaler
02-24-2012, 05:26 PM
I now realize the only thing that I did which I could'nt find in your readme file.

In the fsdbase.cfg file I changed


packagelocation = /var/www/fsdbase/


to


packagelocation = /var/www/fsdbase/userreg/register.php


Otherwise when going from the login screen of fsdbase to the link "register here" I would come back in the main fsdbase screen.

But perhaps I missed something else?
Lex

the whaler
02-24-2012, 05:36 PM
Hi Brett,
Forget this post.
I must have done something else that forces internet to go back to the mail fsdbase page. I'll start from scratch by downloading your file (and deleting what is there at the moment).
I'll let you know if it works or not.
Lex

the whaler
02-24-2012, 06:16 PM
Well it didn't work unfortunately

I did change the fsdbase.cfg back to what is was before my first attempts at your script (this week).
It resides in /var/www/fsdbase along with all other files required.

website = http://fsdbase.lecakyme.nl/


For the user registration:

I put the files in /var/www/fsdbase/userreg

In "connect.php" I have the database requirements.

in register.php I only changed the following:


$site = "http://fsdbase.lecakyme.nl";
$webmaster = "yourwebsite <no-reply@lecakyme.nl>";


The rest I left untouched.

As to mysql. I use webmin to configure (most) of the server files.
But I was unsure as to the way to add extra tables. So I might have done that incorrectly. I first used webmin to add the lines to the databse but that might have been inconrrect so to be sure I deleted the lines in webmin and added them via a console.
I looks ok now.

However, now to my question. I still return to the main page in stead of the registration page when trying the link in the login screen.

Lex

BBuchanan
02-24-2012, 06:26 PM
Well it didn't work unfortunately

I did change the fsdbase.cfg back to what is was before my first attempts at your script (this week).
It resides in /var/www/fsdbase along with all other files required.

website = http://fsdbase.lecakyme.nl/


For the user registration:

I put the files in /var/www/fsdbase/userreg

In "connect.php" I have the database requirements.

in register.php I only changed the following:


$site = "http://fsdbase.lecakyme.nl";
$webmaster = "yourwebsite <no-reply@lecakyme.nl>";


The rest I left untouched.

As to mysql. I use webmin to configure (most) of the server files.
But I was unsure as to the way to add extra tables. So I might have done that incorrectly. I first used webmin to add the lines to the databse but that might have been inconrrect so to be sure I deleted the lines in webmin and added them via a console.
I looks ok now.

However, now to my question. I still return to the main page in stead of the registration page when trying the link in the login screen.

Lex

You need to change a setting in james's script. In stats.pl, use notepad or an editor to find register, you should find:
If you don\'t have a personal CID, you may
<a href=$website>Register Here</a>.

change to:
If you don\'t have a personal CID, you may
<a href=www.yourwebsite.com/register.php>Register Here</a>.

the whaler
02-24-2012, 06:36 PM
Thanks Brett,
I thought it was in there. I changed it but I heard from James a few moments ago the fsdbase might be renewed in about 1 or 2 weeks so I might go back to that if registration would work within fsdbase itself.

However for now so far not so good. I now am back to were I started, a blank screen with no mail sent as well.

Could you test for me if it works from outside my lan.

http://fsdbase.servegame.com

Thanks.
Lex

BBuchanan
03-01-2012, 02:01 AM
Thanks Brett,
I thought it was in there. I changed it but I heard from James a few moments ago the fsdbase might be renewed in about 1 or 2 weeks so I might go back to that if registration would work within fsdbase itself.

However for now so far not so good. I now am back to were I started, a blank screen with no mail sent as well.

Could you test for me if it works from outside my lan.

http://fsdbase.servegame.com

Thanks.
Lex

I'm able to get to your site. I see what you mean by blank screen as well. There may be a hiccup in the apache or php config. I'm currently testing it on a local machine, I've also run it through a centos 5 setup without problem. I'm going to rebuild one of my vps's on ubuntu and track this down.

the whaler
03-01-2012, 07:02 AM
Thanks for checking it Brett.
You might have trouble reaching my site.
I changed to glasfiber last night so my website is unreachable.
Have to contact my provider today.
Lex

BBuchanan
03-01-2012, 07:19 AM
Thanks for checking it Brett.
You might have trouble reaching my site.
I changed to glasfiber last night so my website is unreachable.
Have to contact my provider today.
Lex

Oh no, well... it was reachable last sunday.

BBuchanan
03-31-2012, 11:15 AM
Ok, it's a bug somewhere in it. It isn't just you, tracking back over my coding I've run into your exact issue.

Hopefully, I'll have a bug fix soon.

BBuchanan
03-31-2012, 01:32 PM
Ok, so I've got a updated version up. It only register's and allows users to authenticate. The activation email sent has their CID in it.

http://www.vmatsim.net/register.zip

Josh_1
04-30-2012, 07:26 PM
Hi BBuchanan,

I've tried your download and followed the readme. I've uploaded the files to my site,once i goto the register.php page and fill in the information, hit register it automatically redirects me to an index.php without adding my info to the database,or echoing any success or error message.

I think the offending line is (in register.php):

<form action="index.php" method="post"

Thanks

BBuchanan
04-30-2012, 07:41 PM
Your right.
I'll try to fix it tonight. For those that want to change it themselves:
Change index.php to register.php.

Josh_1
04-30-2012, 08:44 PM
Thanks for that. All works ok now. I notice on post #1 of this topic theres another zip file attached. Does this new one replace/update that? Just notice the other one has more features (login/logout) etc.

Thanks

BBuchanan
05-01-2012, 02:50 AM
Thanks for that. All works ok now. I notice on post #1 of this topic theres another zip file attached. Does this new one replace/update that? Just notice the other one has more features (login/logout) etc.

Thanks

It's a replacement. The OP had features that not everyone wants/needs. So, I removed a bunch of junk and code to make it just the registration/activation process. Now, I'm still working on those features as time allows, but I didn't think anyone would be interested. Not to mention, James's system works, as the old adage goes, don't fix what isn't broken.

Again, I wrote this up for people that wanted/needed something like this. It's meant to be a starting place for everyone to either change or modify to their needs. My OP system barely has any features, but its also in a different programming language. I don't know perl, I'm not going to mess with it. I know some php, I'll tinker with it.

If anyone wants the part of my system that has login/logout and a minimal profile and roster, let me know and I'll end up butchering it some more to be released. But I strongly suggest sticking to the FSDBase as it is and supplementing with this registration/activation setup.

James, if you want to integrate this with your perl, I'm cool with it. I ask, like many would, that my name be attributed with the work. But feel free to do anything else. I'm happy to help everyone with things that I know.