Note that there are some explanatory texts on larger screens.

plurals
  1. POCCPROXY with CURL
    text
    copied!<p>I'm trying to program a script to use CURL as billing software and modify information on CCproxy web Panel.</p> <p>But I have a problem:</p> <p>This is my code :</p> <pre><code>$url="http://xxxxxxx:88/account"; $postfields["form"] = "1"; $postfields["adminpassword"] = "newpassword"; $postfields["changeadminpassword"] = "Modify"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERPWD, 'admin:password'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); $data = curl_exec($ch); curl_close($ch); echo $data; </code></pre> <p>When I used it without post and postfield option then I can echo all user list form ccproxy web panel and its just show page source code with this http response:</p> <p><strong>HTTP/1.0 200 OK Server: CCProxy Pragma: no-cache,no-store Cache-control: no-cache,no-store Connection: close Content-length: 200107 Content-type: text/html</strong> </p> <p>its good for the start but when I try to use postfields and post method I receive http 302 error and nothing work , this is the http response :</p> <p><strong>HTTP/1.1 302 Found Server: CCProxy 6.6 Pragma: no-cache,no-store Cache-control: no-cache,no-store Location: /account</strong> </p> <p>Would you please tell me how can I post queries to ccproxy web panel to modify users or any thing else !</p> <p><strong>As I checked the HTML Form, the action field is "account" and method is "post"</strong></p> <p>Also when I create .html file with this source code its work !</p> <pre><code>&lt;form action="http://xxxxxx:88/account" method="post" name="form"&gt; &lt;input type="text" value="newpassword" name="adminpassword"&gt; &lt;input type="submit" class="button" value="Modify" name="changeadminpassword"&gt; &lt;/form&gt; </code></pre> <p>Thank you</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload