[ale] name=value
Bert Hiddink
hiddink at sipromicro.com
Sat Jul 17 16:18:16 EDT 1999
Hello, Geoffrey
On 16 Jul 99, at 22:00, Wandered Inn wrote:
> Bert Hiddink wrote:
> >
> > Dear Geoffrey,
> >
> > On 16 Jul 99, at 8:41, Wandered Inn wrote:
> > > name=value
> > >
> > > # comes in as $1, so..
> > >
> > > echo ${1#*=}
> > >
> > > # yields
> > >
> > > value
> > >
> >
> > I did some further testing and found out that if the names and values
> > are send from a form, the server does not receive 'name=value' but
> > 'name%3Dvalue'. That is why calling the script from the web, it does not
> > work properly. In case the script is executed from the shell, the server
> > receives 'name=value'.
> >
> > So the problem gets 'reduced' to changing the delimiter '=' to '%3D'.
> > However, if I just substute echo ${1#*=} for echo ${1#*%3D}, it still
> > does not work. I guess because a delimiter can only be one character and
> > not a string of them.
> >
> > Do you have any ideas how to resolve this?
> >
> > Thanks again!
>
> What you are seeing is the encoding of the special character '=' into the
> hex value. The shell will still see an '=' sign. How did you determine
> this was the case? Was it in a log file?
>
> >
> > -brt
> >
> > Bert Hiddink, FUNDACION GALILEO
> > Correo electronico: hiddink at sipromicro.com
> > Sitio: http://www.sipromicro.com
> > Tel. (506) 280 8683, telefax. (506) 280 8847
>
> --
> Until later: Geoffrey esoteric at denali.atlnet.com
>
> It should be illegal to yell "Y2K" in a crowded economy.
> -- Larry Wall, creator of the programming language Perl
>
I became aware by doing the following:
- Put the following test-script in your cgi-bin
#!/bin/sh
echo Content-type:text/html
echo
echo $1
echo ${1#*=}
- Execute from your browser:
http://www.yoursite.net/cgi-bin/test.sh?name%3D100
What shows up in your browser is (at least in mine):
name=100
100
- Now execute from your browser:
http://www.yoursite.net/cgi-bin/test.sh?analog=100
Nothing shows up! My conclusion: the script can not
interprete 'name=value'. However, this the only way a form can send
the string to the server. It can not send 'name%3Dvalue'.
So here I got stuck!
Thanks again in advance for further suggestions!
Regards,
-brt
P.S. I do not know how to do logging as I am on a virtual server and
do not have acces to /var/httpd/log/ or a similar directory.
Bert Hiddink, FUNDACION GALILEO
Correo electronico: hiddink at sipromicro.com
Sitio: http://www.sipromicro.com
Tel. (506) 280 8683, telefax. (506) 280 8847
More information about the Ale
mailing list