You are here

function _recaptcha_qsencode in reCAPTCHA 7

Same name and namespace in other branches
  1. 8 recaptcha-php-1.11/recaptchalib.php \_recaptcha_qsencode()
  2. 5.2 recaptcha/recaptchalib.php \_recaptcha_qsencode()
  3. 6 recaptcha-php-1.11/recaptchalib.php \_recaptcha_qsencode()

Encodes the given data into a query string format

Parameters

$data - array of string elements to be encoded:

Return value

string - encoded request

2 calls to _recaptcha_qsencode()
recaptcha_get_signup_url in recaptcha-php-1.11/recaptchalib.php
gets a URL where the user can sign up for reCAPTCHA. If your application has a configuration page where you enter a key, you should provide a link using this function.
_recaptcha_http_post in recaptcha-php-1.11/recaptchalib.php
Submits an HTTP POST to a reCAPTCHA server

File

recaptcha-php-1.11/recaptchalib.php, line 47

Code

function _recaptcha_qsencode($data) {
  $req = "";
  foreach ($data as $key => $value) {
    $req .= $key . '=' . urlencode(stripslashes($value)) . '&';
  }

  // Cut the last '&'
  $req = substr($req, 0, strlen($req) - 1);
  return $req;
}