Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP Script works, perfect via. a Browser, but only sometimes via. Java
    primarykey
    data
    text
    <p>I use this little PHP Script to create and deliver a captcha to a javaapplication:</p> <pre><code>&lt;?php $secretkey = "***"; header ( 'Content-type: text/xml' ); function generatePassword($length = 5) { $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; $count = mb_strlen($chars); for ($i = 0, $result = ''; $i &lt; $length; $i++) { $index = rand(0, $count - 1); $result .= mb_substr($chars, $index, 1); } return $result; } $user = $_POST['user']; $key = $_POST['key']; $captcha = generatePassword(); if ($key == $secretkey) { try { $dbh = new PDO("mysql:host=localhost;dbname=***", '***', '***'); } catch (PDOException $e) { $error = $e-&gt;getMessage(); echo "&lt;error&gt;$error&lt;/error&gt;"; } $sth = $dbh-&gt;prepare("INSERT INTO xf_captcha (username, captcha) VALUES (:user, :captcha) ON DUPLICATE KEY UPDATE captcha = :captcha", array(PDO::ATTR_CURSOR =&gt; PDO::CURSOR_FWDONLY)); $sth-&gt;execute(array(':user' =&gt; $user, ':captcha' =&gt; $captcha)); $row = $sth-&gt;fetch(PDO::FETCH_ASSOC); echo "&lt;captcha&gt;$captcha&lt;/captcha&gt;"; } else { echo "&lt;error&gt;wrong key&lt;/error&gt;"; } ?&gt; </code></pre> <p>The Problem is, that sometimes the JavaApplication gets 401 Errors. The thing I don´t understand about this is, that it doesn´t seem to be related to the requests sent per minute.</p> <p>If this is excecuted on a apache server without a ddos protection and big firewall, what could be the origin of denying the request ? Is this maybe Apache related ? </p> <hr> <p><strong>Edit:</strong></p> <p>The java part looks like this: <a href="http://pastebin.com/Thi2Htwp" rel="nofollow">http://pastebin.com/Thi2Htwp</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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