Get is being stripped off an HTML form -
i have html form on page. method post, i'm manually adding parameter url string depending on button user clicks. when form submitted, being stripped off url.
i'm baffled this. method has worked many times in past, , this actual form used work fine. suddenly, exact same (formerly working) code doesn't work.
i'm using firefox web developer tools @ parameters passed in request, , there's no sign of get.
<form method="post" target="_blank"> <input type="hidden" name="report" value="abc"> ...a couple select form fields... <input type="submit" action="reports.php?format=pdf" value="go"> [<input type="submit" action="reports.php?format=preview" value="web preview">] </form> basically, if click "go" should pdf, , if click "web preview" same report web page; "format" parameter isn't received on processing end of things.
(i've tried in multiple browsers.)
edit add: can confirm post data being received on processing end. missing.
edit add: if move action <form> tag, works. of course prevents me having 2 buttons 2 things, doesn't solve problem, it's clue might happening. work:
<form method="post" action="reports.php?format=pdf" target="_blank"> <input type="hidden" name="report" value="abc"> ...a couple select form fields... <input type="submit" value="go"> <!-- [<input type="submit" action="reports.php?format=preview" value="web preview">] --> </form>
the first place verify data indeed being sent post request. if, reason, browser thinks form should using request, quite happily delete , replace hardcoded query string.
what suggest doing var_dump() on $_post , $_get in reports.php definitive idea of browser transmitting. there may clues in output.
if $_get data missing, check verify no 1 has put rewrite rule place on server strip query strings off of php requests, or requests specific page. far aware iis not strip query strings post requests, go against established standards, possible rules manually added accomplish same thing.
Comments
Post a Comment