PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Fuzzyhaggis
Forum Newbie
Posts: 2 Joined: Wed Aug 17, 2005 3:40 am
Post
by Fuzzyhaggis » Wed Aug 17, 2005 3:41 am
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!
thomas777neo
Forum Contributor
Posts: 214 Joined: Mon Mar 10, 2003 6:12 am
Location: Johannesburg,South Africa
Post
by thomas777neo » Wed Aug 17, 2005 4:21 am
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
patrikG
DevNet Master
Posts: 4235 Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK
Post
by patrikG » Wed Aug 17, 2005 5:33 am
Fuzzyhaggis
Forum Newbie
Posts: 2 Joined: Wed Aug 17, 2005 3:40 am
Post
by Fuzzyhaggis » Wed Aug 17, 2005 6:40 am
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!
patrikG
DevNet Master
Posts: 4235 Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK
Post
by patrikG » Wed Aug 17, 2005 6:45 am
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.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Aug 17, 2005 7:37 am
could use a template engine like replacement tool.. I've posted how to do that far too many times..