Page 1 of 1
Info from forms as PHP
Posted: Wed Aug 17, 2005 3:41 am
by Fuzzyhaggis
I want a script to take text from a form field (that a user has typed) and treat it as php so that a $string variable typed in will be replaced with its value.
How do I do this - I'm beginning to get a headache over it!
Posted: Wed Aug 17, 2005 4:21 am
by thomas777neo
Could you please give us some more information regarding what you want to do exaclty if you could do what you requested.
I think there is a logical error somewhere, maybe we can help you out with an easier solution
Posted: Wed Aug 17, 2005 5:33 am
by patrikG
Posted: Wed Aug 17, 2005 6:40 am
by Fuzzyhaggis
Yep, for example - if a person types:
blah blah $string blah blah
And hits "submit", the script will change $string into whatever it's supposed to be.
I know about $_POST and all that stuff but thanks for pointing it out anyway!
Posted: Wed Aug 17, 2005 6:45 am
by patrikG
Look into
http://uk2.php.net/eval ,
but be very clear what you allow users to enter there. Otherwise your server gets hacked in no time.
Posted: Wed Aug 17, 2005 7:37 am
by feyd
could use a template engine like replacement tool.. I've posted how to do that far too many times..