formparams('checkToken', 1)){ echo "You are not allowed to access this URL"; return; }to: if($MyForm->formparams('checkToken', 1) && !JRequest::checkToken()){ echo "You are not allowed to access this URL"; return; }like read in post:http://www.chronoengine.com/forums.html?cont=posts&f=2&t=17356&p=48084&hilit=url+submit#p48084.But the data text_pt100=15 is not saved to database.The form code is: pt100    Please help me.Thanks,Fibbio"> How can I post with curl? - Forums

Forums

How can I post with curl?

fibbio 26 Mar, 2010
Hi all,
I'm newbie, I want post data with curl, I'm try with:

curl -d "text_pt100=15&button_2=Submit&0d20cc6730a9eff06ef4108bb5c03270=1&1cf1=17f5adbeca7b57f302500e64d7fa36e8" http://192.168.1.10/mangaliana1/index.php?option=com_chronocontact&task=send&chronoformname=pt100&Itemid=67


the post data is the same I view with wireshark.
I set checkToken:off and I change:
	if((!JRequest::checkToken()) && $MyForm->formparams('checkToken', 1)){
		echo "You are not allowed to access this URL";
		return;
	}

to:
	 if($MyForm->formparams('checkToken', 1) && !JRequest::checkToken()){
                echo "You are not allowed to access this URL";
                return;
        }

like read in post:http://www.chronoengine.com/forums.html?cont=posts&f=2&t=17356&p=48084&hilit=url+submit#p48084.
But the data text_pt100=15 is not saved to database.
The form code is:
<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">pt100</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_1" name="text_pt100" type="text" />
  
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_button">
    <input value="Submit" name="button_2" type="submit" />
  </div>
  <div class="cfclear"> </div>
</div>


Please help me.
Thanks,
Fibbio
GreyHead 27 Mar, 2010
Hi fibbio,

I'm not at all familiar with cURL but looking at the curl I think that the query string and url are wrongly split up. Try this
curl -d "option=com_chronocontact&task=send&chronoformname=pt100&Itemid=67&text_pt100=15&button_2=Submit&0d20cc6730a9eff06ef4108bb5c03270=1&1cf1=17f5adbeca7b57f302500e64d7fa36e8" http://192.168.1.10/mangaliana1/index.php


I still don't know if that will work though.

Bob
fibbio 27 Mar, 2010
Thanks a lot for your fast reply!!!! With your instruction it is working well :mrgreen: .

Fibbio
This topic is locked and no more replies can be posted.