jazzman1 Posted December 21, 2012 Share Posted December 21, 2012 Hey guys, I'm trying to submit a post html form via Bash cURL but without success. That's the url - http://www.djtacho.com/member/plugins/protect/new_rewrite/login.php?v=-any&url=/members/ Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/272244-how-to-get-submit-input-element-value-in-curl-bash-or-php/ Share on other sites More sharing options...
Christian F. Posted December 21, 2012 Share Posted December 21, 2012 The code..? Quote Link to comment https://forums.phpfreaks.com/topic/272244-how-to-get-submit-input-element-value-in-curl-bash-or-php/#findComment-1400715 Share on other sites More sharing options...
jazzman1 Posted December 21, 2012 Author Share Posted December 21, 2012 (edited) Christian,the code is written in Bash Scripting Language. The only way that I see to do this, is to substitute a html form with javascript giving it a name attribute to the submit element. Edited December 21, 2012 by jazzman1 Quote Link to comment https://forums.phpfreaks.com/topic/272244-how-to-get-submit-input-element-value-in-curl-bash-or-php/#findComment-1400761 Share on other sites More sharing options...
jazzman1 Posted December 21, 2012 Author Share Posted December 21, 2012 In fact, after few days research on the web, I've got nothing about this issue. I've solved that quite accidentally. I must share my code with you! When there is no name embed to submit element the default name is "Submit" with capital "S" @Christian, take a look at bash, if you want it. #!/bin/bash NAME='jazzman' PASS='password' TIME=136765423 SUBMIT='%20%20%20Вход%20%20%20' curl --cookie-jar cjar --output /dev/null http://www.djtacho.com/member/plugins/protect/new_rewrite/login.php?v=-any&url=/members/ curl --cookie cjar --cookie-jar cjar --data 'amember_login='$NAME --data 'amember_pass='$PASS --data 'login_attempt_id='$TIME --data 'Submit='$SUBMIT --location http://www.djtacho.com/member/plugins/protect/new_rewrite/login.php?v=-any&url=/members/ curl --cookie cjar --output ~/newFile.html http://www.djtacho.com/members/ Quote Link to comment https://forums.phpfreaks.com/topic/272244-how-to-get-submit-input-element-value-in-curl-bash-or-php/#findComment-1400809 Share on other sites More sharing options...
jazzman1 Posted December 21, 2012 Author Share Posted December 21, 2012 My mistake! The default name of the submit element is not - "Submit" My post above is not completely correct. I'm still struggling in that issue. Sorry about that. Quote Link to comment https://forums.phpfreaks.com/topic/272244-how-to-get-submit-input-element-value-in-curl-bash-or-php/#findComment-1400830 Share on other sites More sharing options...
jazzman1 Posted December 22, 2012 Author Share Posted December 22, 2012 O, Jesus, I've got a wrong logic since the very begining. That's one it's correct! Solved: #!/bin/bash NAME='jazzman' PASS='password' HIDDEN=`date '+%s'` curl --cookie-jar cjar --output /dev/null 'http://www.djtacho.com/member/plugins/protect/new_rewrite/login.php?v=-any&url=/members/' curl --cookie cjar --cookie-jar cjar --data 'amember_login='${NAME} --data 'amember_pass='${PASS} --data 'login_attempt_id='${HIDDEN} --location \ 'http://www.djtacho.com/member/plugins/protect/new_rewrite/login.php?v=-any&url=/members/' curl --cookie cjar --output ~/newFile.htm http://www.djtacho.com/members/center.htm Quote Link to comment https://forums.phpfreaks.com/topic/272244-how-to-get-submit-input-element-value-in-curl-bash-or-php/#findComment-1400852 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.