Jump to content
  • 0

Question

Posted (edited)

how to disable all the symbol using input only letters and number

 

ex. input @input$;

if ( no input symbol == 1) 

 

all the symbol will become error

 

sorry bad english :(

Edited by hakuren

3 answers to this question

Recommended Posts

Posted

prontera,155,185,5	script	sdkfjhsdkfh2	100,{
	input .@test$;
	query_sql "select '"+ escape_sql( .@test$ )+"' regexp '^[a-z0-9]+$'", .@value;
	if ( .@value )
		dispbottom "pass";
	else
		dispbottom "fail";
	end;
}
------ OR ------

 

prontera,150,185,5	script	sdkfjhsdkfh	100,{
	input .@test$;
	if ( preg_match( "^[a-zA-Z0-9]+$", .@test$ ) )
		dispbottom "pass";
	else
		dispbottom "fail";
	end;
}
I still remember last time during eathena times, this preg_match crashed my eathena 12068 test server

I couldn't remember what was the syntax already ... it was 3 years ago

I didn't post on the forum because it was just a custom modification release at the time

if you guys able to find the bug then file a report then ... because now this is an official script command =/

Posted
prontera,155,185,5	script	sdkfjhsdkfh2	100,{
	input .@test$;
	query_sql "select '"+ escape_sql( .@test$ )+"' regexp '^[a-z0-9]+$'", .@value;
	if ( .@value )
		dispbottom "pass";
	else
		dispbottom "fail";
	end;
}
------ OR ------

 

prontera,150,185,5	script	sdkfjhsdkfh	100,{
	input .@test$;
	if ( preg_match( "^[a-zA-Z0-9]+$", .@test$ ) )
		dispbottom "pass";
	else
		dispbottom "fail";
	end;
}
I still remember last time during eathena times, this preg_match crashed my eathena 12068 test server

I couldn't remember what was the syntax already ... it was 3 years ago

I didn't post on the forum because it was just a custom modification release at the time

if you guys able to find the bug then file a report then ... because now this is an official script command =/

 

 

yes it works!

[quote]

prontera,155,185,5    script    sdkfjhsdkfh2    100,{

    input .@test$;

    query_sql "select '"+ escape_sql( .@test$ )+"' regexp '^[a-z0-9]+", .@value;

    if ( .@value )

        dispbottom "pass";

    else

        dispbottom "fail";

    end;

}

 

thank you so much

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...