html - Run Certain PHP code from $_POST? -


server 1 : post name variable server 2. (e.g. "adam")

server 2 : receives post variable , makes new control follows displays adam value.

<input name="name" value="<?php echo $_post['name']; ?>" /> 

wich renders :

<input name="name" value="adam" /> 

now question follows, want pass php code in post variable name, able run on server 2.

for example <?php echo "foo"; ?> passed post variable server 2 render in html.

is possible?

  • if yes, how can done?

  • if no, reason behind know variable being passed being compiled server , php server side script.

yes possible post php code page , use php function eval() process it. (the string evaluating must have return instruction allow kind of response $return = eval("return 5;")

however, not recommend it, it's very open malice.


Comments