View Full Version : Quick Registration Form on a non-vB page
Gary King
05-17-2003, 10:00 PM
Requested Here: https://vborg.vbsupport.ru/showthread.php?postid=394954#post394954
What does this hack do?
It allows people to register at your website (to your vBulletin board) on a non-vBulletin page It provides a much quick method of registration, compared to the usual way only Guests can see this registration form. If the user is already registered, then he/she will see a message instead, such as Welcome back Gary!
Bugs
Found a bug? Please reply back and let me know!
Instructions
Be sure to place the attached code wherever you want the quick registration form to show up.
Enjoy!
Gary King
05-18-2003, 01:21 PM
Hack is now complete, enjoy!
Chris M
05-18-2003, 02:49 PM
Hmm...
Nice idea, but I'm not too keen on this:
mysql_query(
idea...
IMO:
$DB_site->query(
is better;)
and:
if ($redirect=="yes") {
should be
if ($_GET['redirect']=="yes") {
:)
Satan
Franki
05-18-2003, 03:33 PM
It seems to work fine Gary! I tested it.
Very useful hack.
Gary King
05-18-2003, 03:46 PM
Today at 11:49 AM hellsatan said this in Post #3 (https://vborg.vbsupport.ru/showthread.php?postid=396722#post396722)
Hmm...
Nice idea, but I'm not too keen on this:
mysql_query(
idea...
IMO:
$DB_site->query(
is better;)
and:
if ($redirect=="yes") {
should be
if ($_GET['redirect']=="yes") {
:)
Satan
For $DB_site->query();, I'd either have to define the class and create the object for it, or include /forum/global.php
The way I've done it is good enough, in my opinion.
Chris M
05-18-2003, 04:15 PM
Ok;)
To me it made more sense, but each to his own;)
Satan
Nebby
06-02-2003, 01:16 AM
I'll be installing this now :D
Perfect for what i want ^^
Nebby
06-02-2003, 01:19 AM
EDIT: NM, i tested it, it just goes back to quickreg.php
WEForums
06-02-2003, 02:28 AM
Just curious. Is it possible to do this without it being on the same domain? I know you can do logins this way so I was curious if it's possible to do this as well.
Gary King
06-02-2003, 07:04 PM
Yesterday at 11:28 PM WEForums said this in Post #9 (https://vborg.vbsupport.ru/showthread.php?postid=403229#post403229)
Just curious. Is it possible to do this without it being on the same domain? I know you can do logins this way so I was curious if it's possible to do this as well.
Yes, it is. Some minor modifications would have to be made to the file, though. For example, the config.php variables would not be accessible, so you would have to add those manually.
Gary King
06-02-2003, 07:05 PM
Yesterday at 10:19 PM Nebby said this in Post #8 (https://vborg.vbsupport.ru/showthread.php?postid=403216#post403216)
EDIT: NM, i tested it, it just goes back to quickreg.php
Where would you want it to go?
WEForums
06-02-2003, 11:20 PM
Yesterday at 09:04 PM Gary W said this in Post #10 (https://vborg.vbsupport.ru/showthread.php?postid=403502#post403502)
Yes, it is. Some minor modifications would have to be made to the file, though. For example, the config.php variables would not be accessible, so you would have to add those manually. To be clear, PHP files would be necessary for this hack to work? Or could it be done via HTML only? The website uses .shtml extensions is why I ask, and there isn't any PHP files on it. Don't really want to add any. ;)
Gary King
06-02-2003, 11:29 PM
The PHP file that processes the registration could be located somewhere else, just as long as the HTML file has access to it.
WEForums
06-02-2003, 11:36 PM
Could you give me an example? Sorry to bug you but I don't exactly have the greatest of knowledge of this stuff, and it seems you know a LOT about this. (Been viewing a lot of your posts/threads.) ;)
Gary King
06-02-2003, 11:41 PM
Maybe the PHP file is accessible via FTP, or on the same server.
P.S.
Why not simply place the PHP file that processes the script, in the same directory as the HTML file, if you don't want to use a PHP file for the quick registration page?
WEForums
06-02-2003, 11:50 PM
Today at 01:41 AM Gary W said this in Post #15 (https://vborg.vbsupport.ru/showthread.php?postid=403618#post403618)
Maybe the PHP file is accessible via FTP, or on the same server.I am sure they're on the same server but just a separate domain. (I do not 'own' the site, I just run the forums.)
Today at 01:41 AM Gary W said this in Post #15 (https://vborg.vbsupport.ru/showthread.php?postid=403618#post403618)
P.S.
Why not simply place the PHP file that processes the script, in the same directory as the HTML file, if you don't want to use a PHP file for the quick registration page? Wouldn't you still have to click onto another page? I simply would like the quick registration to be on the page rather than it having its very own page. You know, having the form on the HTML page?
The only reason for this is the site receives about 15,000-25,000 unqiue hits per day. The forums have 22,000-some odd members, but we're really looking to expand even more.
Gary King
06-02-2003, 11:57 PM
Yes, you can have the form on the HTML page. So, you do not wish to have the form on a .PHP page? That is not at all possible? (May I ask why not?)
You can simply have the PHP file process the actual registration, while the HTML only "tells" the PHP page to register the user.
WEForums
06-03-2003, 12:04 AM
So you could use HTML to "call" for the script's form, correct? And the script could be on a separate domain as well, right?
If so, would you find giving an example of the HTML? I have no experience working with forms... : (
Gary King
06-03-2003, 12:21 AM
As long as the PHP script is accessible by the HTML file.
Example that you could use:
HTML file
<form action='quickreg.php' method='post'>
Username: <input type='text' name='username'>
<br>Password: <input type='password' name='password'>
<br>Email: <input type='text' name='email'>
<br><input type='submit' name='submit' value='Submit' accesskey='s'>
<input type='reset' name='reset' value='Reset' accesskey='r'>
</form>
PHP file (name it quickreg.php, otherwise you must change the action='' in the HTML file to whatever this file is called)
<?php
////////////////////////////////////////////////////////////////////////////////////////////
// VARIABLES
// $config = relative path to your vBulletin's /admin/config.php (must be on same server)
// $groupid = user group ID for people who register using this form
// $redirect = leave it as "yes" if you want to redirect the user to the vBulletin after he/she registers
////////////////////////////////////////////////////////////////////////////////////////////
// board information
$config="forum/admin/config.php";
$groupid="2";
$redirect="yes";
///////////////////////////////////////////////////////////////////////////
// DO NOT MODIFY ANYTHING BELOW HERE
// UNLESS YOU KNOW WHAT YOU ARE DOING
///////////////////////////////////////////////////////////////////////////
$config=strtolower($config);
require($config);
$connect=mysql_connect($servername,$dbusername,$db password);
mysql_select_db($dbname);
if ($submit) {
$unique=mysql_query("SELECT username FROM user WHERE username='$username'");
$user=mysql_query("INSERT INTO user (usergroupid, username, password, email, joindate,
lastvisit, lastactivity) VALUES ('".$groupid."', '".htmlspecialchars(addslashes($username)).
"', '".addslashes(md5($password))."',
'".addslashes(htmlspecialchars($email))."', '".time()."', '".time()."', '".time()."')",$connect);
$userid=mysql_insert_id();
$userfields=mysql_query("INSERT INTO userfield (userid) VALUES ($userid)");
if (($user==TRUE) and ($userid==TRUE) and ($userfields==TRUE)) {
header("Location: index.html");
}
if ($redirect=="yes") {
$board=str_replace("admin/config.php","index.php",$config);
print "<meta http-equiv='refresh' content='0;URL=".$board."'>";
}
mysql_close($connect);
}
}
?>
Try that, tell me if it works. I simply modified some things from the original code.
WEForums
06-03-2003, 12:29 AM
I got a parse error.
http://www.weforums.com/quickreg3.php
Only thing I changed was...
forum/admin/config.php
to
forums/admin/config.php
Gary King
06-03-2003, 12:34 AM
Try the attached file.
WEForums
06-03-2003, 12:40 AM
http://www.weforums.com/quickreg2.php
http://www.weforums.com/quickreg3.php (blank...?)
Strange, the attached file is 3, but 2 is the original file (first post in the thread).
WEForums
06-03-2003, 12:44 AM
I got it to work. Thanks a lot! :)
Gary King
06-03-2003, 12:47 AM
<a href="http://www.weforums.com/quickreg3.php" target="_blank">http://www.weforums.com/quickreg3.php</a> is blank because it doesn't output anything, it only processes the registration.
And no problem, glad you got it working. Also, please click on the Install button if you are keeping this hack, thanks!
WEForums
06-03-2003, 12:49 AM
Today at 02:47 AM Gary W said this in Post #24 (https://vborg.vbsupport.ru/showthread.php?postid=403656#post403656)
And no problem, glad you got it working. Also, please click on the Install button if you are keeping this hack, thanks! Oops, I try to remember to click them all, but sometimes I forget. Thanks for reminding me, and done. :)
Nebby
06-03-2003, 07:38 PM
Yesterday at 09:05 PM Gary W said this in Post #11 (https://vborg.vbsupport.ru/showthread.php?postid=403505#post403505)
Where would you want it to go?
i wanted it to go to my site index page, but i'd edited it so it does that now.
Gary King
06-03-2003, 07:40 PM
Alright.
Elvis
06-08-2003, 12:12 AM
Any idea how to set the new user to require email confirmation, and also set them to be put in the moderated group once they validate the email address?
M4g!k
06-20-2003, 06:35 AM
Warning: main(forum/admin/config.php) [function.main]: failed to create stream: No such file or directory in /home/indeathw/public_html/regester.php on line 21
Fatal error: main() [function.main]: Failed opening required 'forum/admin/config.php' (include_path='.:/usr/local/lib/php') in /home/indeathw/public_html/regester.php on line 21
-that's what i get. All i dont was installed it and link to it. is there more i must do?
Gary King
06-20-2003, 12:30 PM
Today at 03:35 AM M4g!k said this in Post #29 (https://vborg.vbsupport.ru/showthread.php?postid=410938#post410938)
Warning: main(forum/admin/config.php) [function.main]: failed to create stream: No such file or directory in /home/indeathw/public_html/regester.php on line 21
Fatal error: main() [function.main]: Failed opening required 'forum/admin/config.php' (include_path='.:/usr/local/lib/php') in /home/indeathw/public_html/regester.php on line 21
-that's what i get. All i dont was installed it and link to it. is there more i must do?
You must place the correct path for $config - you have an incorrect path.
gmarik
06-20-2003, 02:56 PM
Nice, nice. Does it
works on 2.3 now?
Gary King
06-20-2003, 04:24 PM
Today at 11:56 AM gmarik said this in Post #31 (https://vborg.vbsupport.ru/showthread.php?postid=411076#post411076)
Nice, nice. Does it
works on 2.3 now?
It always did :)
evildj
07-01-2003, 05:08 AM
Its a decent hack.
How about the cookie though, so when they go the forum page they don't have to login?
Thanks, DJ
themonarch
08-30-2003, 08:16 AM
Beauty hack! I changed the redirection to go to a webpage that will link to a credit card processing thing, to enable registration with payment.
Bobbo
11-20-2003, 12:49 AM
Great hack. Many thanks!
This one has great potential for my site. One thing that I've been trying to figure out is how to have my form populate a custom userfield on Submit in addition to the basic registration.
Could someone please give me some direction on the code for the proper insert to add data to for example my field6 custom field? Ideally, I would add a radio check box on the form for different divisions of a company, so when a user enters their name, pass, and e-mail, they would also pick a division which would add the info to the custom field.
Any help is greatly appreciated.
Bob
BlackxRam
12-17-2003, 02:42 AM
This is a nice addition very simple, but it should atleast try to prevent automated registrations, or check to see if the user already has an account... i can goto this page if im registered and just keep registering new names.. need to prevent AUTOMATED registrations and the loss of registration checks. Can this be implemented?
Gary King
12-17-2003, 11:20 AM
Thanks for bringing this to my attention, I've fixed it so that only Guests can see this registration form now, instead of everyone. If the user is already registered, then he/she will see a message instead, such as Welcome back Gary! :)
bandit022
12-19-2003, 08:04 PM
so does the form have to be placed on a php page in order for it to only show up to gets, and the welcome text show up to members???
i have tested it on my index.html and the form shows up to everyone. the form iteself works great, i just don't want it showing up to everyone.
-jeff
Gary King
12-19-2003, 08:27 PM
Yeah, it will only work on a PHP page because it uses PHP functions.
9baller
02-11-2004, 12:31 PM
Will this work for vB3?
Gary King
02-11-2004, 07:41 PM
Will this work for vB3?
I haven't tried it with vB 3 yet, but I'm not 100% it will work completely with vB 3. Although maybe someone could try and let me know ;)
Any idea how to set the new user to require email confirmation, and also set them to be put in the moderated group once they validate the email address?
Any comments on this Gary?
Hi Gary,
I have loaded it up to my test board, but after completing the quick registration form the form doesnt add the user to my board or even give me any confirmation.
What can i do?
Thanks in advance.
Gary King
03-09-2004, 01:07 AM
Hi Gary,
I have loaded it up to my test board, but after completing the quick registration form the form doesnt add the user to my board or even give me any confirmation.
What can i do?
Thanks in advance.
All I can say is, make sure you follow instructions carefully and change the variables at top of quickreg.php
All I can say is, make sure you follow instructions carefully and change the variables at top of quickreg.php
Are you refering to this instruction??
Instructions
Be sure to place the attached code wherever you want the quick registration form to show up.
Simple, I created a page called quickreg.php (with your code only) and called it to the browser.
It opened correctly, but wont submit!
and my variables are
// board information
$config="localhost/forum/admin/config.php";
$groupid="2";
$redirect="yes";
$registeredmessage = "Welcome back ".$bbuserinfo['username']."!";
What else could go wrong?
Gary King
03-09-2004, 06:51 PM
What version of vBulletin?
What version of vBulletin?
vB2.3.0
Gary King
03-09-2004, 07:54 PM
vB2.3.0
I have no idea what's wrong , it should be working just fine and unless you changed something, etc. then I'm not sure what's wrong.
Its got me bewildered!
I uploaded the quickreg.php on its own without any additional code (for testing)
and i amended my $config location to suit!
I cant see anything that could go wrong.
I am testing it on my PC using Tecks "how to run vB on your PC" guide.
All my other hacks i am testing have worked, ie Lesanes store Hack, Quick reply, stats/level hack etc.
Its really buggin me now, becuase your hack doesnt interact with any of the others and its the simplest to load!
So to answer your question, there is nothing to change in your hack that i can see that would stop it from working.
note: when i forst installed it, i got the stream error, but that was fixed when i amended the $config location.
Still hoping to rectify this. (i used the file from your 1st page, not the other version further in the thread, would this be the problem??)
Gary, i am going to give this a try again!
Could you also tell me if you can enable the quick registration with image verification???
I hope you reply to this!
Gary King
03-17-2004, 10:39 PM
I'm not really going to work much on this anymore because it's old, no one else wants it and I'm busy with vBulletin 3, work and life :)
Hi Gary,
Thanks for letting me know what is and isnt happening with this thread!
Could you at still tell me whether it will work with image verification or not??
You may already know the answer or a quick fix.
Note: I am not asking you to research this, just asking you politely to delve into your knowledge and share some of it with me if it can handle the image verification.
If you are not able to support it anymore like you say, you probably best amend it where it says "The Author agreed to give support for this hack!"
Gary King
03-18-2004, 01:17 PM
You could copy the code for image verification from register.php :)
Hi Gary,
I did get this working finally. Thought i would let you know that there are some security issues such as guests can register with a user name and no password or email address.
Were you aware of this?
Regards
GLO
Osterling
03-25-2004, 11:22 AM
any pic so i can see what it looks like first?
<a href="http://www.glo-racing.com" target="_blank">www.glo-racing.com</a> then go to Account Info, then create account, and you can see it there!
Hazzo
04-08-2004, 05:55 PM
I haven't tried it with vB 3 yet, but I'm not 100% it will work completely with vB 3. Although maybe someone could try and let me know ;)
User account gets created, but the password varable doesnt seem to work right..
Gary King
04-08-2004, 07:07 PM
User account gets created, but the password varable doesnt seem to work right..
Yeah that's because of the new salt and higher encryption methods in vB3.
LoOnEyToOnZ
05-18-2004, 02:33 AM
Someone port it to VB 3 please ! :)
roxics
09-07-2004, 10:15 PM
Well I installed it and it works well. The only problem is that it doesn't detect if someone is already a member. It just gives them the form anyway and they can register as many times as they like. It would also be nice if the script logged them in.
MeTaL_oRgY
09-18-2004, 12:15 PM
this could be a heck of a hack if just someone could work more on it... I wish I knew more php than I currently do... but damn, I need this hack X_X!!! someone plz HELP!! I would love to have this hack along with the following features:
* REQUIRE the 3 fields before accepting the registration.
* After someone register, don't print the form again.
* A flood protection so users can't register more than once a day (this would discourage people from being stupid and register a thousand times....
MeTaL_oRgY
09-18-2004, 03:40 PM
well, as I said.. the script could be a great thing if only someone could work on it a little.. so I started searching and I finally made it!!! This fixed version will:
* Print the "Welcome back [username]" message if they are already logged in when visiting the form page. (optional)
* Won't allow a username that already exists to register again. (I know this one was there before, but then gary posted an html form that had this bug)
* Force all 3 fields to be filled before registering user.
* Optional menu after registration, so they can go to your forum, homepage, their usercp, etc. etc., anything you want.
* Two files on the zip, one for people who want the "Welcome back" message and one for those who don't want it OR will put the form on a html page.
It's not a very big modification, but helped me a LOT
LIVE EXAMPLE: www.ingosranch.ifobos.com/registro.php (SPANISH)
GREAT HACK!
and.. LONG LIVE vB 2.3.x!!!!!!!!! :banana:
EDIT
Sorry, I forgot to add a small little exit;..(well, actually 3 of them :P) .. this causes that if they didn't fill a field, they would get the error message, but the username woudlb e registered anyways.... hmmm.. aaanyways.. File updated :P
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.