Solved

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

Posted on 2004-09-02
11
274 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now