Solved

get form bug : = becomes %3D ....

Posted on 2004-09-02
11
275 Views
Last Modified: 2010-04-09
Hi - This get form converts the '=' and '&' signs into '%3D' and '%26'


I tried giving the second value a name "myapple" but it still doesn't work however I play with it.


========
<body>

<form method="get">
<input type="hidden" name="keywords">

<input type="hidden" name="myapple" value="locale=us&mode=blended&input_string">



<input type="text" name="search" size="20" maxlength="255"><br />


<input type="submit"style="width:150;text-align:center" value="listings"onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.isearch.com/cgi-bin/ppc/search/smartsearch.cgi?keywords ';"> <br />

<input type="submit"style="width:150;text-align:center" value="Amazon"onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.theeas.com/cgi-bin//us.cgi?locale=us&mode=blended&input_string ';"> <br />

</form>  



</body>
</html>
0
Comment
Question by:macuser777
  • 5
  • 4
11 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 11966860
this is correct actually, you just need to decode (or unescape) the value passed, e.g.:

this.form.keywords.value = unescape(this.form.search.value)
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 11966870
OH WAIT!  I didn't see that you were changing the action of the form ... in that case do it in the cgi, not in the script as I have shown above.
0
 
LVL 4

Author Comment

by:macuser777
ID: 11966928
>>>>I didn't see that you were changing the action of the form ... in that case do it in the cgi, not in the script as I have shown above.          

any way of doing it without going into the cgi? the cgi is an off the shelf which I have no idea how to get round. I know next to nothing...really next to...about cgi.

If there's no other way if you give me some guidance i'll get a freelance to do it.

theres a bit more to it...Thanks

<input type="text" name="search" size="20" maxlength="255"><br />

<input type="submit"style= "width:150;text-align:center" value="Web Search" onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.iarch.com/cgi-bin/search/smartsearch.cgi?keywords ';"> <br />

<input type="submit" style="width:150;text-align:center" value="Dmoz" onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.search.com/odp.php ';"> <br />

<input type="submit"style="width:150;text-align:center" value="PPC listings"onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.iarch.com/cgi-bin/ppc/search/smartsearch.cgi?keywords ';"> <br />

<input type="submit"style="width:150;text-align:center" value="Amazon"onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.ther.com/cgi-bin//us.cgi?locale=us&mode=blended&input_string ';"> <br />

</form>  
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 4

Author Comment

by:macuser777
ID: 11967578
the other pproblem is that the normal search comes up

us&input_string=river&mode=blended


and i've had to change it to

us&mode=blended&input_string=river

to make it 'work'
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 11967896
you can try changing the form from "get" to "post" ...
the default behavior for get is to encode those characters on the query string, so it would have to be done at the cgi.
0
 
LVL 4

Author Comment

by:macuser777
ID: 11968115
Ok - by just changing the get to post the other 3 stay working and the query string in the last stays intact...but it does a blank search

maybe it's not coded right - here's the actual code --- if you post an answer PLEASE change the url's so the domains don't get spidered by google on this page

When you get to the amazon search you can type in any query to see how the url normally appears

===========
<form method="post">
<input type="hidden" name="keywords">

<input type="hidden" name="locale=us&mode=blended&input_string">

<input type="text" name="search" size="20" maxlength="255"><br />

<input type="submit"style= "width:150;text-align:center" value="Web Search" onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.i   ~~~~~ pure ~~~~~ search.com/cgi-bin/search/smartsearch.cgi?keywords ';"> <br />

<input type="submit"style="width:150;text-align:center" value="PPC listings"onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.i   ~~~~~   pures  ~~~~~~ search.com/cgi-bin/ppc/search/smartsearch.cgi?keywords ';"> <br />

<input type="submit"style="width:150;text-align:center" value="Amazon"onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.the~~~~~easy   ~~~~  river.com/cgi-bin//us.cgi?locale=us&mode=blended&input_string ';"> <br />

</form>  
0
 
LVL 4

Author Comment

by:macuser777
ID: 11976951
some progress...

I can stop the code rewriting by splitting up the query, but the problem now is with the form names. The last serach would work if I could get the &search= out of the url. I've tried taking out 'search' completely and replacing with input_string throughout but that disables the second search???

It's no better using post instead of get.

<form method="get">  
 <input type="hidden" name="keywords">  
 
 <input type="hidden" name="locale" value="us">  
 <input type="hidden" name="mode" value="blended">  
 <input type="hidden" name="input_string">  
 <input type="text" name="search" size="20" maxlength="255"><br />  
 
 <input type="submit"style= "width:150;text-align:center" value="Web Search" onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.isearch.com/cgi-bin/search/smartsearch.cgi?keywords ';"> <br />  
 
 <input type="submit"style="width:150;text-align:center" value="DMOZ"onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.isearch.com/odp.php ';"> <br />  
 
 <input type="submit"style="width:150;text-align:center" value="PPC listings"onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.isearch.com/cgi-bin/ppc/search/smartsearch.cgi?keywords ';"> <br />  
 
 <input type="submit"style="width:150;text-align:center" value="Amazon"onclick="this.form.keywords.value = this.form.input_string.value; this.form.action = ' http://www.theeasyriver.com/cgi-bin/us.cgi? ';"> <br />  
 
 </form>
0
 
LVL 4

Author Comment

by:macuser777
ID: 12025717
Hi knightEknight.

I've solved this by changing the search form name in the php search.

Please tell me how you'd like to close this q up.

Thanks for the input

macuser                    
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 12025731
post a comment for admin to refund your points.
0
 

Accepted Solution

by:
CetusMOD earned 0 total points
ID: 12057876
Closed, 150 points refunded.
CetusMOD
Community Support Moderator
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question