Finding the script element in a String with strpos | PHP -


how can find element in string php function strpos. parse error whenever execute function $error string.

[symfony\component\debug\exception\fatalerrorexception] parse error

 $error =  'you have error in sql syntax;                        check manual corresponds mysql server version                right syntax use near             '"=<script>alert('o7v87r99ib')</script>"' @ line 1';             $str = '=<script>alert('o7v87r99ib')</script>';                  if(strpos($error, $str)){                     echo 'found: ' . $str;                 } 

you have multiple errors, $error string not valid string. missing $ str in echo.

<?php  $error =  'you have error in sql syntax;                        check manual corresponds mysql server version                right syntax use near             \'"=<script>alert(\'o7v87r99ib\')</script>"\' @ line 1';  $str = "=<script>alert('o7v87r99ib')</script>";  if(strpos($error, $str)){     echo 'found: ' .$str; } 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -