I got a HTML file which contains a form that contains a textbox txtName and a input button butSearch and action is Query.php
When I click the button it goes to
http://localhost/Query.php?txtName=anj&butSearch=Search
Everything is fine - I just dont want the parameters shown in the url. I want this to be seen in the address bar :
http://localhost/Query.php
I tried using hidden fields but hidden fields also get shown in the url.
I have seen this happen during registration etc - the url contains the php file but not the parameters.
Is there a way to do this ?
Thanks
To show a parameterless URL
Moderator: General Moderators
Not mentioned GET nor POST
But I have not mentioned neither GET nor POST : Just this :
Thanks
Code: Select all
<FORM ACTION="Query.php">
Name :
<INPUT name=txtName title="Searches for any keyword in the name">
<INPUT type="Submit" value="Search" name=butSearch>
</FORM>-
Straterra
- Forum Regular
- Posts: 527
- Joined: Mon Nov 24, 2003 8:46 am
- Location: Indianapolis, Indiana
- Contact:
Re: Not mentioned GET nor POST
Try this code.anjanesh wrote:But I have not mentioned neither GET nor POST : Just this :ThanksCode: Select all
<FORM ACTION="Query.php"> Name : <INPUT name=txtName title="Searches for any keyword in the name"> <INPUT type="Submit" value="Search" name=butSearch> </FORM>
Code: Select all
<FORM ACTION="Query.php" METHOD="post">
Name :
<INPUT name=txtName title="Searches for any keyword in the name">
<INPUT type="Submit" value="Search" name=butSearch>
</FORM>Yes thanks I tried this and worked sucessfully. Now I have another problem in this code. If I click the Search button it'll work but if I hit enter in the textbox after typing some text the quesry sent is (this one without the method=post to know what is being sent):
http://localhost/Query.php?txtName=anj
and not
http://localhost/Query.php?txtName=anj& ... rch=Search
The name SubmitBasicSearch is not being sent when we hit the enter key. I wrote a javascript method for onkeypress for that textbox and determine if the keyCode is 13 - if so then send the correct url but that doesn't happen.
Also Straterra : You told to include POST - I tried GET too. It worked as well so whats the difference b/w POST & GET here ?
Anyone ?
Thanks
http://localhost/Query.php?txtName=anj
and not
http://localhost/Query.php?txtName=anj& ... rch=Search
The name SubmitBasicSearch is not being sent when we hit the enter key. I wrote a javascript method for onkeypress for that textbox and determine if the keyCode is 13 - if so then send the correct url but that doesn't happen.
Also Straterra : You told to include POST - I tried GET too. It worked as well so whats the difference b/w POST & GET here ?
Anyone ?
Thanks