RP Name Check for PHP.
#1

Hello.
I know that this section is meant to problems with SA-MP but actually this is related to SA-MP. : D
There are dozens of smart people who can help me, I know it.

Alright. I need a advice how to create a Role Play name check in PHP registration. I'm not familiar with PHP, that's why I'm asking this here.
Reply
#2

It is not related to Pawn if it is PHP. This isn't a PHP scripting discussion board.
Reply
#3

Php help forum - ****** search
Reply
#4

This check if a "_" is in the name
PHP код:
       <?
            $name 
"HelloWorld";
            
$pos  strpos($name"_");
            
            if (
$pos === false)
            {
                echo 
"no:(";    
            }
            else echo 
"yes";
        
        
?>
Reply
#5

Quote:
Originally Posted by ReVo_
Посмотреть сообщение
This check if a "_" is in the name
PHP код:
       <?
            $name 
"HelloWorld";
            
$pos  strpos($name"_");
            
            if (
$pos === false)
            {
                echo 
"no:(";    
            }
            else echo 
"yes";
        
        
?>
Thank you.
Reply
#6

Quote:
Originally Posted by ReVo_
Посмотреть сообщение
This check if a "_" is in the name
PHP код:
       <?
            $name 
"HelloWorld";
            
$pos  strpos($name"_");
            
            if (
$pos === false)
            {
                echo 
"no:(";    
            }
            else echo 
"yes";
        
        
?>
Not the best practice, try HelloWorld_
Better code (Untested)
PHP код:
<?php
 $sName 
"SomeName_YouWantCheck"
 
$aName explode('_'$sName);
 if(
count($aName) < || strlen($aName[0]) < || strlen($aName[1]) < 1)
 {
    echo 
'You not enter RP name';
 }
else 
{
   echo 
'You entered RP name';
}
?>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)