Witam, mam pytanie jak wysłać metodą post pytanie na serwis ask.fm poprzez CURL
Mam coś takiego :
jednak wywala : 301 Moved Permanently
kod html <form> na profilu ask.fm wygląda tak :
Mam coś takiego :
Kod:
<?php
$c = curl_init();
curl_setopt($c, CURLOPT_URL, 'http://www.ask.fm/NaMaxaWybuzowana/questions/create');
curl_setopt($c, CURLOPT_POST, 1);//przesylamy metodą post
curl_setopt($c, CURLOPT_POSTFIELDS, 'authenticity_token=fBzIuTR0lj026C+59e5AVEM8nRmTOK115MyFeCSZoC4=&question[question_text]=Co slychac&commit=commit'); //dane do wyslania
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
$page = curl_exec($c);
curl_close($c);
echo $page;
?>
jednak wywala : 301 Moved Permanently
kod html <form> na profilu ask.fm wygląda tak :
Kod:
<form action="/NaMaxaWybuzowana/questions/create" autocomplete="off" id="question_form" method="post" onsubmit="$.ajax({data:$.param($(this).serializeArray()) + '&authenticity_token=' + encodeURIComponent('fBzIuTR0lj026C+59e5AVEM8nRmTOK115MyFeCSZoC4='), dataType:'script', type:'post', url:'/NaMaxaWybuzowana/questions/create'}); Forms.Profile.afterSubmit(); return false;" style="display:block"><div style="margin:0;padding:0;display:inline"><input name="authenticity_token" type="hidden" value="fBzIuTR0lj026C+59e5AVEM8nRmTOK115MyFeCSZoC4=" /></div>
<div id="profile-title">
<div class="profile-title-text">
<span class="text-headline" dir="ltr"><span dir="ltr">Zadaj mi pytanie</span></span>
</div>
</div>
<div id="postLoaderTerritory">
<textarea class="composeQuestion-form growable-textarea" id="profile-input" name="question[question_text]"></textarea>
<div id="postLoader"></div>
</div>
<div id="post_options-border">
<div id="post_options">
<div id="generalLevel">
<div class="profile-title-counter" id="question_counter_span"></div>
<input class="submitBlue submitBlue-active" id="question_submit" name="commit" onclick="return Forms.Profile.allowSubmit(this)" type="submit" value="Zapytaj" />
</div>
</div>
</div>
</form>