Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

ODBC Registerpage V2

Newbie Spellweaver
Joined
Aug 14, 2009
Messages
67
Reaction score
2
hi i have this error can you help me?

Fatal error: Uncaught Error: Call to undefined function sql_regcase() in C:\xampp\htdocs\odbc\index.php:27 Stack trace: #0 C:\xampp\htdocs\odbc\index.php(105): antisql('180.190.163.54') #1 {main} thrown in C:\xampp\htdocs\odbc\index.php on line 27
 
Joined
Jul 11, 2012
Messages
786
Reaction score
190
hi i have this error can you help me?

You are probably using newer versions of PHP, sql_regcase() function was DEPRECATED in PHP 5.3.0, and REMOVED in PHP 7.0.0.
preg_match() and preg_quote() are alternatives to this function.
Here:

The error also says that the function is undefined.
 
Joined
Jul 11, 2012
Messages
786
Reaction score
190
i'm just using XAMPP latest version. :(

XAMPP version has nothing to do with PHP version.
XAMPP is an application which allows you to setup a web server and database server instantly without any additional configuration. Whereas, PHP is a scripting language used to develop websites.

Also, I've gave you the solution, just use one of the alternative functions above instead of sql_regcase()
 
Newbie Spellweaver
Joined
Aug 14, 2009
Messages
67
Reaction score
2
Fatal error: Uncaught Error: Call to undefined function odbc_connect() in C:\xampp\htdocs\index.php:23 Stack trace: #0 {main} thrown in C:\xampp\htdocs\index.php on line 23

After Applying sir. i got this error..
You are probably using newer versions of PHP, sql_regcase() function was DEPRECATED in PHP 5.3.0, and REMOVED in PHP 7.0.0.
preg_match() and preg_quote() are alternatives to this function.
Here:

The error also says that the function is undefined.

Solaire - ODBC Registerpage V2 - RaGEZONE Forums
 
Joined
Jul 11, 2012
Messages
786
Reaction score
190
After Applying sir. i got this error..


Solaire - ODBC Registerpage V2 - RaGEZONE Forums

The error is occurring because you're not providing all the function's required parameters, as preg_match() has two required parameters and you're providing only one (the rest of the parameters are optional).
The first required parameter for preg_match() is a regular expression (a set of characters that define a search pattern), and the second required parameter is the input string.
So basically the code will be like that:
Code:
preg_match("/(from|select|insert|delete|where|drop table|show tables|#|--|\\\\)/i", $sql)

Make sure you have an i at the end of the regular expression, it means case-insensitive (uppercase and lowercase letters would be considered equivalent).
Hope this solves the problem
 
Last edited:
Newbie Spellweaver
Joined
Aug 14, 2009
Messages
67
Reaction score
2
im am very appreciate your effort but sorry sir i did copy your code and this is the display. what is the problem with this? ??????

Parse error: syntax error, unexpected '$sql' (T_VARIABLE) in C:\xampp\htdocs\index.php on line 28
 
Skilled Illusionist
Joined
Oct 29, 2012
Messages
312
Reaction score
26
@Tannous you're right.

a simple comment to this topic: extremely old register, using functions no longer existing in current versions of php (like preg_match, your error trygun182). It is highly recommended that you look for something more up to date and obviously more secure.

this weekend i will code a simple registration page using more modern and updated standards, you are not the first to search for this type of content and you cannot find it.
 
Joined
Jul 11, 2012
Messages
786
Reaction score
190
im am very appreciate your effort but sorry sir i did copy your code and this is the display. what is the problem with this? ������

Edit:
With me explaining, I forgot something important, pay attention that the function preg_match() returns 1 or 0, and we're using it inside preg_replace(), which is wrong, we need to have a regular expression there.
The whole point of preg_match is to detect SQL queries even if they're using uppercase or lowercase letters, you could solve that by using the 3rd parameter of preg_match(). However, to avoid all confusion, just get rid of preg_match(), and use only preg_replace() with more specific regular expression.
Replace the whole line with this:
Code:
preg_replace("/([Ff][Rr][Oo][Mm]|[Ss][Ee][Ll][Ee][Cc][Tt]|[Ii][Nn][Ss][Ee][Rr][Tt]|[Dd][Ee][Ll][Ee][Tt][Ee]|[Ww][Hh][Ee][Rr][Ee]|[Dd][Rr][Oo][Pp] [Tt][Aa][Bb][Ll][Ee]|[Ss][Hh][Oo][Ww] [Tt][Aa][Bb][Ll][Ee][Ss]|#|--|\\\\)/" , "", $sql);
This will cover all the possibilities.
Now I hope this solves it.
 
Newbie Spellweaver
Joined
Aug 14, 2009
Messages
67
Reaction score
2
Edit:
With me explaining, I forgot something important, pay attention that the function preg_match() returns 1 or 0, and we're using it inside preg_replace(), which is wrong, we need to have a regular expression there.
The whole point of preg_match is to detect SQL queries even if they're using uppercase or lowercase letters, you could solve that by using the 3rd parameter of preg_match(). However, to avoid all confusion, just get rid of preg_match(), and use only preg_replace() with more specific regular expression.
Replace the whole line with this:
Code:
preg_replace("/([Ff][Rr][Oo][Mm]|[Ss][Ee][Ll][Ee][Cc][Tt]|[Ii][Nn][Ss][Ee][Rr][Tt]|[Dd][Ee][Ll][Ee][Tt][Ee]|[Ww][Hh][Ee][Rr][Ee]|[Dd][Rr][Oo][Pp] [Tt][Aa][Bb][Ll][Ee]|[Ss][Hh][Oo][Ww] [Tt][Aa][Bb][Ll][Ee][Ss]|#|--|\\\\)/" , "", $sql);
This will cover all the possibilities.
Now I hope this solves it.

i can not solve it sir i got this error again. :(

Fatal error: Uncaught Error: Call to undefined function odbc_connect() in C:\xampp\htdocs\index.php:23 Stack trace: #0 {main} thrown in C:\xampp\htdocs\index.php on line 23



edit: just added on php.ini extension=php_odbc.dll..

Fatal error: Uncaught Error: Call to undefined function eregi() in C:\xampp\htdocs\index.php:52 Stack trace: #0 C:\xampp\htdocs\index.php(149): checkemail('alv@gma...') #1 {main} thrown in C:\xampp\htdocs\index.php on line 52
 
Joined
Jul 11, 2012
Messages
786
Reaction score
190
i can not solve it sir i got this error again. :(

This has nothing to do with the previous error, it's a completely different one, this time the odbc_connect() function is undefined, and most likely because you don't have ODBC driver, or you haven't loaded php_odbc or seomthing.
Search for Fatal error: Uncaught Error: Call to undefined function odbc_connect() in google, you'll find plenty of stuff.

Little advise, try to google things before you ask, these stuff can be found all over the internet.
Good luck.
 
Newbie Spellweaver
Joined
Aug 14, 2009
Messages
67
Reaction score
2
edit: just added on php.ini extension=php_odbc.dll..

Fatal error: Uncaught Error: Call to undefined function eregi() in C:\xampp\htdocs\index.php:52 Stack trace: #0 C:\xampp\htdocs\index.php(149): checkemail('alv@gma...') #1 {main} thrown in C:\xampp\htdocs\index.php on line 52
 
Joined
Jul 11, 2012
Messages
786
Reaction score
190
edit: just added on php.ini extension=php_odbc.dll..

Fatal error: Uncaught Error: Call to undefined function eregi() in C:\xampp\htdocs\index.php:52 Stack trace: #0 C:\xampp\htdocs\index.php(149): checkemail('alv@gma...') #1 {main} thrown in C:\xampp\htdocs\index.php on line 52

Once again, all syntax and definition errors are all over the internet, search for them or DM tomorrow afternoon, I'll give you a hand.
 
Back
Top