Syntactic Confectionery Delight | |
PerlMonks |
Sending data to browser's URI field via POSTby hacker (Priest) |
on Mar 12, 2005 at 22:54 UTC ( [id://439016]=perlquestion: print w/replies, xml ) | Need Help?? |
hacker has asked for the wisdom of the Perl Monks concerning the following question: I've got this new application I'm piecing together, and I've got all of the innards coded and working, and it works well (minus some scaling issues with my understanding of mod_perl; more on that in another future node). I'm assigning new content to a row in MySQL with an id (auto_increment) and a unique_id (some hashing of Data::UUID, thanks to revdiablo for the hint there), along with several other columns. The goal, is that the content in the row, would be accessed by hitting a url like the following, in a browser: http://pss.example.com/86e1b327ccc39a38 That unique_id would be the key to return the URl, content, and other items from that row in the database. Right now, I'm using an HTML form to submit that URL for fetch and conversion, using POST. If the URL submitted is unique, a new row is added. If it is not unique (already exists in the database), the duplicate row is updated. Is it possible to submit an HTML form, which insert this row in the database, and tack on the UUID hash to the end of the URI field in the POST'd page, so that when the submitted page is rendered, the URL in the browser's URI field, is that hash, as above? I know this is confusing-sounding, so here's an example:
Currently, using POST for the HTML form, the user's browser would continue to show http://pss.example.com in their browser's URI field. I would like it to show something like: http://pss.example.com/86e1b327ccc39a38 instead, so they can bookmark it and use it for future fetches/conversions without having to use the form interactively. The catch is, I can't populate the form action with that UUID, because I won't know it until after the user submits the form and the URL they enter is fetched and validated. (Before you suggest it merlyn, PATH_INFO is not an option in this case). Any way to do this? Maybe switching to GET + some mod_rewrite fu? Something else?
Back to
Seekers of Perl Wisdom
|
|