Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 03-07-2011, 05:08 AM
Shex's Avatar
Shex Shex is offline
Member
 
Join Date: Apr 2010
Posts: 14
Credits: 3,580
Shex
Default Invite Code/Alpha Code

I've installed Mys now and I'd like to add a feature to the registration page:
The users have to enter a special code to be able to join.

The plan is easy, I add a code in the mysql db and when a user registers and puts in this code, he gets the userID which I "reserved" for him.


As I am no coder, I just tried to do so.

I edited the registration page, so that the box to enter the code shows up (and I am kinda proud of it xD)

Code:
<p>Usercode: <input name='usercode' type='text' id='usercode' maxlength='20'></p>
  	<p>Enter your code here. Currently no codes are given out, sorry.
Then I added the usercode into adopts_users db, settings:
usercode varchar(20) latin1_swedish_ci Null:No Standart:None UNIQUE


And I added the "grab user information from the form"
Code:
$usercode = $_POST["usercode"];

I think it is right so far.

The last thing I edited is the query to compare the data to the db. I guess that doesn't work this way ^^

Code:
$usercode = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $usercode);
$usercode = secure($usercode);

Does anyone know what I have to change so it works? ^^
Thanks
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for someone to code for me :) Infernette Staff Central 33 02-03-2014 05:44 PM
PHP Code. Aasixx Questions and Supports 2 09-17-2012 06:15 PM
Could some one code this..? Abronsyth Questions and Supports 5 04-13-2012 08:27 PM
I need a simple code Cosma Questions and Supports 2 01-26-2010 05:55 AM
Need a code to vote Cosma Questions and Supports 0 01-25-2010 05:24 PM


All times are GMT -5. The time now is 07:48 PM.

Currently Active Users: 1102 (0 members and 1102 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636