PHP Issue! what is a function for...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • galleryseek
    Confirmed User
    • Mar 2002
    • 8234

    #1

    PHP Issue! what is a function for...

    I'm trying to submit a couple textareas which contain actual php coding text as content, to a mysql table. The problem is... is mysql errors when I submit it because it tries to actually execute the php coding... while all I want to do is just store the coding in a table...

    I know there has to be some type of function I can run the textarea variables through first that will temporarily render the coding so that php won't try to execute it, anyone know what it is?

    Thanks
  • tical
    Confirmed User
    • Feb 2002
    • 6504

    #2
    encode the variables before they go in... decode after they're out

    and i think the eval() function will be useful

    http://www.php.net/eval
    112.020.756

    Comment

    • galleryseek
      Confirmed User
      • Mar 2002
      • 8234

      #3
      Originally posted by tical
      encode the variables before they go in... decode after they're out

      and i think the eval() function will be useful

      http://www.php.net/eval
      so I "encode" the variables first with eval?

      ie:

      $php_coding = eval($_POST['php_coding');

      $query = "INSERT INTO table (php_coding) VALUES ($php_coding)";

      ?

      Comment

      Working...