Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
- <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
- <script>
- $(document).ready(function() {
- $("#tabs").tabs();
- });
- </script>
- <script type="text/javascript">
- $(document).ready(function() {
- //the min chars for username
- var min_chars = 3;
- //result texts
- var characters_error = 'Minimum amount of chars is 3';
- var checking_html = 'Checking...';
- //when button is clicked
- $('#check_username_availability').click(function(){
- //run the character number check
- if($('#username').val().length < min_chars){
- //if it's bellow the minimum show characters_error text
- $('#username_availability_result').html(characters_error);
- $(checking_html).hide();
- }else{
- //else show the cheking_text and run the function to check
- $('#username_availability_result').html(checking_html);
- check_availability();
- $(checking_html).hide();
- }
- });
- });
- //function to check username availability
- function check_availability(){
- //get the username
- var username = $('#username').val();
- //use ajax to run the check
- $.post("check_username.php", { username: username },
- function(result){
- var response = jQuery.parseJSON(result);
- var username = response.username;
- var referer = response.referer;
- if(response.available === true){
- //show that the username is available
- $('#username_availability_result').html('<span class="is_available">Player has not yet been referred, woo!</span>');
- }else{
- //show that the username is NOT available
- $('#username_availability_result').html('<span class="is_not_available"><b>' +username + '</b> has already been referred, he was referred by someone else. Try someone else.</span>');
- }
- });
- }
- </script>
- </head>
- <body style="font-size:62.5%;">
- <?
- require ("config/config.php");
- $result = mysql_query('select * from refer');
- $row = mysql_fetch_array($result);
- $usercheck = $row['username'];
- $referercheck = $row['referer'];
- $session = "olimoli123";
- ?>
- <div id="tabs">
- <ul>
- <li><a href="#fragment-1"><span>Refer</span></a></li>
- <li><a href="#fragment-2"><span>Referal History</span></a></li>
- <li><a href="#fragment-3"><span>Rewards</span></a></li>
- </ul>
- <div id="fragment-1">
- <form name="validate" action="refvalidate.php" method="POST">
- <p>Minecraft User:
- <input type='text' name='username' id='username'><input type='button' id='check_username_availability' value='Check Availability'>
- </p>
- <p>Email Address:
- <input type='text' id='email' name='email'>
- </p>
- <p> </p>
- <p>
- <textarea rows="10" cols="50">
- Join me on iCraftSMP, We have jobs, money and other goodies!
- </textarea>
- </p>
- <p>
- <script>
- $(document).ready(function() {
- $("button").button();
- });
- </script>
- </p>
- <button> Refer! </button>
- </form>
- </br>
- <div id='username_availability_result'></div>
- </br>
- <div id='email_availability_result'></div>
- </div>
- <div id="fragment-2">
- <?
- // Table here
- ?>
- </div>
- <div id="fragment-3">
- Rewards include:
- dadadad.
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement