note 107229 added to function.eval
| From: | nopepeno at yahoo dot com | Date: | Mon, 23 Jan 2012 12:06:40 +0000 |
| Subject: | note 107229 added to function.eval | ||
| Groups: | php.notes php.notes | ||
| Request: | Send a blank email to php-notes+get-185711@lists.php.net to get a copy of this message | ||
<?php
//an example of how not to use eval!
//if you put
$user_input =' world ';
eval("echo 'Hello '.$user_input.', how are you?';");
//this will print out: Hello world, how are you?
//but if the user enters
$user_input =' hell;// ';
eval("echo 'Hello '.$user_input.', how are you?';");
//will print out: Hello hell
?>
----
Server IP: 69.147.83.197
Probable Submitter: 71.235.61.235
----
Manual Page -- http://www.php.net/manual/en/function.eval.php
Edit -- https://master.php.net/note/edit/107229
Del: integrated -- https://master.php.net/note/delete/107229/integrated
Del: useless -- https://master.php.net/note/delete/107229/useless
Del: bad code -- https://master.php.net/note/delete/107229/bad+code
Del: spam -- https://master.php.net/note/delete/107229/spam
Del: non-english -- https://master.php.net/note/delete/107229/non-english
Del: in docs -- https://master.php.net/note/delete/107229/in+docs
Del: other reasons-- https://master.php.net/note/delete/107229
Reject -- https://master.php.net/note/reject/107229
Search -- https://master.php.net/manage/user-notes.php