Click to See Complete Forum and Search --> : URL Encode Problem


amit_tgo
03-19-2004, 09:47 AM
Hello,

I have a web form that submits data.

The code is as follows

<form action="http://www.collectionofthoughts.com/supriya1/mysite/merchant/test/243434/test12345.php?" name="f"><span id=hf></span><table cellspacing=0 cellpadding=0><tr valign=middle><td align=center>


<input maxLength=256 size=55 name=ref value="kavita">
<input maxLength=256 size=55 name=progid value="105">
<input maxLength=256 size=55 name=linkid value="24">
<input maxLength=256 size=55 name=merurl value="http://www.google.com">

<input maxLength=256 size=55 name=q value="">
<script>
document.f.q.focus();
</script>
<br><input type=submit></td></tr></table></form>

So when you take this code and place it in your html page, on submitting the form, it takes you to the url : http://www.collectionofthoughts.com/supriya1/mysite/merchant/test/243434/http%3A%2F%2Fwww.google.com

Thats bcos the value http://www.google.com is being encoded.


It should have actually taken you to the url : http://www.collectionofthoughts.com/supriya1/mysite/merchant/test/243434/test12345.php?ref=kavita&progid=105&linkid=24&merurl=http://www.google.com&q=&meta=

Which creates the cookie and then redirects you to http://www.google.com



I need to get rid of the encoded url.

Perhaps, i believe the html page in which i have my form needs to be modified someway, perhaps some javascripting that will get rid of any encoded stuff.

Help Please!

Anxiously awaiting a solution!

Regards
Amit

amit_tgo
03-19-2004, 02:07 PM
Anxiously awaiting some solution :(
Please Help

Kor
03-20-2004, 02:18 AM
I don't quite understand your problem... If, after submit the pages switches to somewhere is the server-side application's fault, not a submit problem...

I don't get your point, really

chestertb
03-20-2004, 05:55 AM
The problem you seem to have is in the 12345.php script, and not your form.

You have two choices.

EITHER
You can validate the form with javascript, then submit it from the javascript like this;

In your header...
<script language="javascript">
function makecookie()
{
>>some code that validates your data and makes your cookie<<
return true;
}

And in the form...
<form action="http://www.collectionofthoughts.com/supriya1/mysite/merchant/test/243434/test12345.php?" name="f" onsubmit="return makecookie();">

OR
You can submit it as it is, and use 12345.php to create a php cookie before it loads google (ask the question in the php forum)

CTB