• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Check name in shopsystem.php

marcelao777

New Member
Joined
Sep 9, 2011
Messages
81
Reaction score
0
Hi, my page shopsystem.php is work, but i need to validate the name of the player before purchase, if the name exist in bd etc.

follows the code if anyone can help I thank.

Code:
{
            $buy_id = (int) $_POST['buy_id'];
            $buy_name = stripslashes(urldecode($_POST['buy_name']));
            $buy_from = stripslashes(urldecode($_POST['buy_from']));
            if(empty($buy_id))
            {
                $main_content .= 'Por favor <a href="index.php?subtopic=shopsystem">selecione o  item</a> primeiro.';
            }
            else
            {
                if($buy_offer['type'] == 'changename'){
                if(!check_name_new_char($buy_from))

			
					
				
                {
                    $main_content .= 'Formato invalido do novo nome.';
 		   		}
                }
                else
                {
                    $buy_offer = getItemByID($buy_id);
                    $check_name_in_database = $ots->createObject('Player');
                $check_name_in_database->find($buy_from);
                if($buy_offer['type'] == 'changename'){
                if(!$check_name_in_database->isLoaded()) {
                }
                }
                    if(isset($buy_offer['id'])) //item exist in database
                    {
                        if($user_premium_points >= $buy_offer['points'])
                        {
                            if(check_name($buy_name))
                            {
                                $buy_player = new OTS_Player();
                                $buy_player->find($buy_name);
                                if($buy_player->isLoaded())
                                {
                                    $buy_player_account = $buy_player->getAccount();
                                    if($_SESSION['viewed_confirmation_page'] == 'yes' && $_POST['buy_confirmed'] == 'yes')
                                    {
 
Back
Top Bottom