Jump to content


Photo

Executing PHP code from $string


  • Please log in to reply
3 replies to this topic

#1 hardyvoje

hardyvoje
  • New Members
  • Pip
  • Newbie
  • 6 posts
  • LocationSerbia

Posted 23 July 2006 - 02:36 PM

Hello,

Is there possibility to execute code from $string?

I would like to store some PHP code in database, and them to include it somehow in page.
This code should be modified dinamycly and then executed? is that possible?

Thanks!

I'm running free design resources portal with photos, illustrations, 3d models, web templates, themes, sounds, loops, tutorials... etc. All resources are public domain - usable in commercial and non commercial projects. check it!

#2 Joe Haley

Joe Haley
  • Members
  • PipPipPip
  • Advanced Member
  • 103 posts
  • LocationCanada, eh?

Posted 23 July 2006 - 02:37 PM

http://php.net/manua...nction.eval.php
Give a man a fish; you have fed him for today.  Teach a man to fish; and you have fed him for a lifetime
Don't teach men to program. Teach them to fish.

Please, try the RTFM solution before asking for help:
http://php.net/manual/en/index.php

#3 hardyvoje

hardyvoje
  • New Members
  • Pip
  • Newbie
  • 6 posts
  • LocationSerbia

Posted 23 July 2006 - 02:38 PM

Thanks man!
I'm running free design resources portal with photos, illustrations, 3d models, web templates, themes, sounds, loops, tutorials... etc. All resources are public domain - usable in commercial and non commercial projects. check it!

#4 Joe Haley

Joe Haley
  • Members
  • PipPipPip
  • Advanced Member
  • 103 posts
  • LocationCanada, eh?

Posted 23 July 2006 - 04:24 PM

Please, do remember:

Validate user input, removing any possible PHP code when evaling a string.
Give a man a fish; you have fed him for today.  Teach a man to fish; and you have fed him for a lifetime
Don't teach men to program. Teach them to fish.

Please, try the RTFM solution before asking for help:
http://php.net/manual/en/index.php




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users