Url encoding Help Pls!


#1

Hi guys,

it’s me again, I want to come up with the following url:

www.mysite.com/webpage?myid=1

I keep coming up with the following url:

www.mysite.com/webpage%3Fmyid%3D1

require ‘uri’
$myurl = URI.escape(“webpage?myid=”)
redirect_to(:action => $myurl + 1 )

what am I doing wrong?

I also tried
require ‘cgi’
$myurl = CGI::unescape(“webpage?myid=”)
redirect_to(:action => $myurl + 1 )

oh no, what’s going wrong? Also, on top of that, can you help what the
difference between CGI and URI is?

thanks in advance,

Bing


#2

Don’t know if this is helpful or not, but try something like this
instead:

id = 1
@myurl = “http://www.website.com/?myid=#{id}”)
redirect_to @myurl

oc

Bing wrote:

require ‘uri’
oh no, what’s going wrong? Also, on top of that, can you help what the
difference between CGI and URI is?

thanks in advance,

Bing


A | c/o Marie Eikrem, Fagerborggt 48A, NO-0360 OSLO
M | +47 411 44 384
W | http://www.foo.mu