validate code submitted with php. Making sure there are no errors?

Discussion in 'PHP' started by Anveto, Nov 4, 2011.

  1. #1
    Just like geshi allows you to highlight code I was wondering if there was a way to make sure code is valid when someone submits code in a form. Is there an open source script that will check multiple programming languages for syntax errors and such?

    I want to check first of all php, but also c#, c++, Java, javascript, html, asp, c, objective c, and VB

    Thanks!
     
    Anveto, Nov 4, 2011 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    If you want multi language checking, you're best bet is to use regular expressions to match or reject a user submitted data. Most programmers use custom of predefined functions which obviously wouldn't be cross platform compatible. A regex is the only cross platform method of validation that I can think of, unless there is some validation web service with an API that you could integrate with.
     
    jestep, Nov 4, 2011 IP
  3. Anveto

    Anveto Well-Known Member

    Messages:
    697
    Likes Received:
    40
    Best Answers:
    19
    Trophy Points:
    195
    #3
    Thanks! But I would really like something I can go of of that is not API based.

    When the form is submitted I will know what language it is if that makes it any easier, the user has to specify language.
     
    Anveto, Nov 4, 2011 IP