简体   繁体   中英

PHP Injection not displaying echo in textbox

I was trying to insert some php code into one of those dummy practice sites but it isn't displaying anything on the page after submitting the field.

So in the name field, I typed in <?php echo "test"; ?> <?php echo "test"; ?> . So after I submit this, I expect to see something like Name: test but instead I am seeing Name: . So like nothing is showing after the name. So when I inspect the element on my web browser, I see this <p> Name: </p><pre><?php echo "test"; ?></pre> <p> Name: </p><pre><?php echo "test"; ?></pre>

Is the php code not running?

Is the php code not running?

No, it isn't. The code is just being output back to the browser (where it is treated as an unknown HTML tag).

This is probably because the "dummy practise site" is not set up to allow people to execute arbitrary PHP on their servers simply by submitting it over HTTP, which would be a massive security problem and rapidly turn them into either:

  • A bitcoin farm
  • A spam farm
  • Both

It Will not work. PHP is a server side . You can't run PHP on client side.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM