I'm trying to embed a PHP page, but the PHP code goes to the web browser.

The problem you're experiencing is that you cannot use a PHP file (neither
ASP or Perl) when embedding page results, because the PHP code in the
result pages will never be processed by the webserver.

Read the documentation to know how embeded and redirect result pages work.