Talk:Block people from Website if they have a domain name
From Hack Wars Wiki
Did Not Do The Research
Did you check your code?
Syntax Error parsing function enter. compiler returned [Runtime error.]
Obviously you did not.
if (holder[x] = alphabet[x1]) |
if (alm = true) |
== or != but never =.
I fixed it in my test script to ==
Syntax Error parsing function enter. compiler returned [Runtime error on line 10 in declaration of 'alm'.]
bool alm = false; |
Well, bool should work, but it doesn't. Use boolean instead.
Function toUpperCase() not found
What?.... Functions#General_Functions
Third entry: toUpper()!
And now the kicker ():
int main() { string me=getSourceIP(); //If you want to use this in an HTTP script you have to change it to getHostIP() or a constant string like "127.0.0.1" string IP = me;//getVisitorIP(); string alphabet[] = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; // bool alm = false; boolean alm = false; int lets = length(alphabet); int ipLen = strlen(IP); // IP = toUpperCase(IP); IP = toUpper(IP); string backup = IP; string holder[]; holder = split(backup, char(32)); for(int x = 0; x <= length(holder); x++) { for (int x1 = 0; x1 <= length(alphabet); x1++) { // if (holder[x] = alphabet[x1]) if (holder[x] == alphabet[x1]) { alm = true; } } } string mes = "access "; // if (alm = true) if (alm == true) mes += "denied"; else mes += "granted"; message(me,mes); } |
access denied
And I do not have an Domaino/DNS. In short terms: your code cannot different a domain from an IP. Luckily you don't even block the visitor. Instead of showing them "403 Access forbidden" or anything other you like on your page to make clear that you really block them (that was what I expected when I read the title), all you do is to close the shop - and you do that for everybody. BTW: why don't you log the visitors with domains? Neither the code nor the comments make that clear.Silverlight 11:15, 15 December 2009 (UTC)
