* GIGAWAP This xtscript
<!--parser:xtscript-->
# Get the username from the form
get username

# Check for a cookie or default to the entered name from the form
var $username = call cookie::get $name=mycookie;$default=$username

# If the username is set refresh or create the cookie and output the username
if $username
call cookie::set $name=mycookie; $val=$username; $expire=99999999;$force_current=1;
print <span class="">$username</span>
else

# Show the form
var $self=<xt:url />
print {{
<form action="$self" method="post">
<input name="username" />
<input type="submit" />
</form>}}
endif
<!--/parser:xtscript-->

get added to the banned user name to be used? Example: name admin banned in use to sign in.
How does anyone know? Please help me.
2015-02-06 05:53 · (0)
* Graham * GIGAWAP Try something like this
<!--parser:xtscript-->
var $banned_names= comma,separated,list,of,banned,names
var $len =call strlen $val=$banned_names
var $self=<xt:url />
get logout
if $logout
call cookie::delete $name=mycookie;$force_current=1;
endif
get username
var $username = call cookie::get $name=mycookie;$default=$username
var $checkname = call strtolower $val=$username
var $start=0
@loop 
var $end= call strpos $haystack=$banned_names,;$needle=,;$offset=$start
var $value= call substr $val=$banned_names;$start=$start;$length=($end-$start)
if $value == $checkname
del $username
print <b>Name not allowed</b><br />
goto @end
endif
if $end < $len
var $start=($end+1)
goto @loop
endif
@end
if $username
call cookie::set $name=mycookie; $val=$username; $expire=99999999;$force_current=1;
print {{<span class="">$username</span>
<form action="$self" method="post">
<input name="logout" type="hidden" value="1"/>
<input type="submit" value="logout" />
</form>}}
else
print {{
<form action="$self" method="post">
<input name="username" type="text" value=""/>
<input type="submit" value="login" />
</form>}}
endif
<!--/parser:xtscript-->

Copy code
2015-02-10 04:33 (edited 2015-02-10 04:35 by Graham ) · (0)
* GIGAWAP * Graham thanks mr.graham I like it, I ask for help like that that name used to enter my site, the name of adult content that can not be used to login the site :)
2015-02-13 05:17 · (0)
* tmyusuf It's a very helpful code to you.
2015-05-25 00:09 · (0)
* Aash * Graham Again superb code by you! Thanks!
2015-05-25 00:59 · (0)

Online: Guests: 1