I have this html form here:
<form action = "<?php $_PHP_SELF ?>" id="addTip" method = "POST">
Título: <input type = "text" name = "title" />
Tipo: <input type = "text" name = "type" />
Data: <input type = "text" name = "data" />
Imagem: <input type = "text" name = "image" />
<input type = "submit" />
</form>
<textarea name="comment" form="addTip">Enter text here...</textarea>
and I call it on a php file like this:
if($_REQUEST["title"] || $_REQUEST["type"] || $_REQUEST["data"] || $_REQUEST["image"]){...}
The html code is below the php one, so the code above is all in 1 page.
When I open the file, the REQUEST returns an error saying that every <input>
has undefined index, except type and image.
If i change the names of image and type, those <input>
don't work either.
If I change the names back again to image and type the code works and if I only use those as $_REQUEST
, my php code works well.
Why I'm having this behaviour?