To be strictly accurate, it wasn't working in the first instance
purely because the $_SERVER['PHP_SELF'] was not actually being output
(nothing to do with use of $_SERVER after html output!).

You can use either echo or print, doesn't matter which ...

<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>"  ...
or
<form method="POST" action="<?php print $_SERVER['PHP_SELF']; ?>"  ...

or even the shortform if your PHP settings allow it (not recommended
though)...
<form method="POST" action="<?= $_SERVER['PHP_SELF']; ?>"  ...


On Oct 31, 10:55 am, resetstudio <[EMAIL PROTECTED]> wrote:
> Hi!
> This happens because you use $_SERVER after an html output.
> You shoud set a variable after
> <?php
> require("include/conexao.php");
> $this_page=$_SERVER["PHP_SELF"] ;
> ....
>
> and in the form
> <form method="POST" action="<?php print $_SERVER["PHP_SELF"] ; ?>" (where you 
> forgot to use the print constructor and the ";")
>
> ...
> And should work!

Reply via email to