Rosky Posted April 23, 2011 Share Posted April 23, 2011 In a <form> that send requests to a fileserver (data bases) trough a url into a Javascript , I wanna avoid that the URL shows in adress bar of browsers.I has declare "method="post" in <form>, but this method only is parsed in Opera. In all rest of browsers (IE, Chr, FF and Safari) URL show in adress bar... I put "return false;" in each "onsubmit=..." and at end of "location.href = "... into Jscript... The <form>:-----------------<form method="post" onsubmit="enviaelform(); return false;"> <fieldset> <input type="text" id="Unoo" value="" size="11" onkeyup="java script:pasaelValor()" name="T1" /> <input type="hidden" id="Doos" /> <input type="hidden" id="Trees" /> <input type="submit" value="Buscar" onclick="java script:enviaelform()" /> <input type="reset" value="Borrar" /> </fieldset> </form>------end paste-----------The java script: function pasaelValor(){ ocur1 = document.getElementById("Unoo").value.split(" ").join("%24%22+OR+%22"); ocur2 = document.getElementById("Unoo").value.split(" ").join("%24%23+OR+%23"); ocur3 = document.getElementById("Unoo").value.split(" ").join("%24+o+");} function enviaelform(){ location.href = "/database/?t2000=%28%22" + ocur1 + "%24%22%29&t2001=%28%23" + ocur2 + "%24%23%29&t2002=%28allfields%3D" + ocur3 + "%24%29&t2003=20&t2004=1"; return false;} Any idea?? Link to comment Share on other sites More sharing options...
Ingolme Posted April 24, 2011 Share Posted April 24, 2011 Your Javascript code is opening a URL rather than submitting the form. Link to comment Share on other sites More sharing options...
Rosky Posted April 24, 2011 Author Share Posted April 24, 2011 Hello guy, we are together again Your Javascript code is opening a URL rather than submitting the form.So so.... But it is running very well from years ago, when security wasn't current headache... The db isn't relational, and is a bit old.Years ago, I created a mode to request data from and between three db, trough send the request in a form for each one. Work when the user get data in a field of a db. Then trough a link in this field, with the <form> and JS we send the data field into a URL that includes the call to cgi-bin in other database... I hope that's clear... How could we avoid that url shows in adress bar? Can you help me(again)? Link to comment Share on other sites More sharing options...
Ingolme Posted April 24, 2011 Share Posted April 24, 2011 Currently your Javascript is just opening a URL. If you want the data hidden you're going to have to either send an AJAX POST request or just let the form submit without Javascript intervention. Link to comment Share on other sites More sharing options...
Rosky Posted April 24, 2011 Author Share Posted April 24, 2011 [...] just let the form submit without Javascript intervention. How does you do it?? It's possible send hidden data in outgoing URL and sending data copied in a searching in a <form> for request in cgi-bin of another form in outside fileserver and databse, trough Internet?? While, I tell you this work so: user do search, and type "word" in text box. User wanna know about this "word", but this search is in a db running on outside fileserver.Then user do click in button of <form> and it send "word" encapsuled (in JS) with the same url that the db could use in a local request. If for a search in local sesion the call to cgi-bin is: </databases/cgi-bin/wi32.exe/[calltocgi.ini]/?t2000=%28%22"word"%24%22%29&t2001=%28%23"word"%24%23%29&t2002=%28Todos+los+campos%3D"word"%24%29&t2003=20&t2004=1">The same URL in JS is next (you see it in code pasted above), where "+ ocurx +" is "word":<"/databases/cgi-bin/wi32.exe/[calltocgi.in]/?t2000=%28%22" + ocur1 + "%24%22%29&t2001=%28%23" + ocur2 + "%24%23%29&t2002=%28Todos+los+campos%3D" + ocur3 + "%24%29&t2003=20&t2004=1">I hope that you don't is sleeping now... It's some complicated for explain and more in other language... Link to comment Share on other sites More sharing options...
thescientist Posted April 24, 2011 Share Posted April 24, 2011 just look at the tutorialshttp://www.w3schools.com/html/html_forms.asphttp://www.w3schools.com/php/php_forms.asphttp://www.w3schools.com/php/php_post.asp Link to comment Share on other sites More sharing options...
Ingolme Posted April 24, 2011 Share Posted April 24, 2011 You can choose where the data is sent using the action attributes of the form: <form action="http://somesite.com/form_process.php" method="post"> Link to comment Share on other sites More sharing options...
Rosky Posted April 24, 2011 Author Share Posted April 24, 2011 just look at the tutorialshttp://www.w3schools.com/html/html_forms.asphttp://www.w3schools.com/php/php_forms.asphttp://www.w3schools.com/php/php_post.asp Thanks, beyond that I has read until now several courses (classroom), manuals and tutorials for CDS/Isis and interface WWWIsis implementation on web, idea in this current web server (I'm not self made hosting) is not use php (it's IIS and syadmin don't wants php) neither asp, only html... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.