Params from html form

Hello everyone, need some quick assistance.

Having difficulty grabbing these two variables and including them in a post url.

You can see ruby pulls the POST variables as expected (testing using p params or params.to_s)

{“e”=>“77”, “a”=>"", “save”=>“Save Info”}

in my .rb file I have the following:

post ‘/1.php’ do
#puts params.inspect
#p params
postData = Net::HTTP.post_form(URI.parse(‘[](’), {‘save’=>‘Save Info’, ‘e’=>‘params[:e]’, ‘a’=>‘params[:a]’})
puts postData.body


Now when I submit my form in the logs i see:

[save] => Save Info
[e] => params[:e]
[a] => params[:a]
params[:e] info saved! - - [18/Jul/2019:19:55:54 -0400] “POST /1.php HTTP/1.1” 200 - 0.0208

It shows whats in the ‘’ and not the actual variables. Now, I have tried all sorts of different things to pull the params but nothing seems to work. Can somebody tell me how i can pull each variable properly?

Thank you in advance.

figured it out. sheesh. solution for anyone else wondering

postData = Net::HTTP.post_form(URI.parse(‘’), {‘save’=>params[:save], ‘e’=>params[:e], ‘a’=>[:a]})

      • [19/Jul/2019:12:34:18 -0400] “GET /main.css HTTP/1.1” 200 219 0.0048
        [save] => Save Info
        [e] => 7
        [a] => a
        7 info saved! - - [19/Jul/2019:12:34:24 -0400] “POST /1.php HTTP/1.1” 200 - 0.0221
1 Like

---- ignore

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.