php - Trying to pass variable in url -


i'm echoing form:

 echo "<form action='/leaguemaster/fichatorneio.php?id=" . $_get['torneioid'] . "'>"; 

when submit form , links page action, variable i'm passing doesn't reach page...

/leaguemaster/fichatorneio.php? 

i've done in other pages , worked, don't know what's going on here. i've tried having same form outside php echo , same result.

-edit-

this full form:

echo "<form method='get' action='/leaguemaster/fichatorneio.php?id= " . $_get['torneioid'] . "'>"; echo "<input type='submit' value='voltar'>"; echo "</form>"; 

use hidden type form's element named id:

 echo "<form action=\"/leaguemaster/fichatorneio.php\">";  echo "<input type=\"hidden\" name=\"id\" value=\"$_get[torneioid]\" />" 

notice: i did not set method attribute form because method default method html forms , makes form submits values through url query string.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -