Skip to content
Advertisement

I have a 500 error with preg_match syntax

I’m dealing with this php script, which when executed on the host gives a 500 error, apparently the line where the preg_match is is the one that contains the error…

this file is going to be executed as a cron to validate.

JavaScript

Advertisement

Answer

You have extra double quotes in the regular expression. You also have extra spaces inside the [] in the regexp. You can replace that character class with w, which matches alphanumerics and underscore.

JavaScript

Another problem: You use a number of variables before you assign them:

  • $modleName
  • $checkToken
  • $key
  • $sellKey
  • $dir

Did you post the code out of order?

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement