Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

dimvic/hcaptcha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

1. Set the environment variables

  • hcaptcha_sitekey
  • hcaptcha_secret
  • hcaptcha_log_path if you want responses to be logged

Using putenv('key=value'), $_ENV['key'] = 'value' or $_SERVER['key'] = 'value'

Alternatively, class methods can be called with the key/secret as parameters.

Logging is possible only by setting the environment variable.

2. Include hCaptcha in a form

dimvic\HCaptcha::getDiv(?string $siteKey = null): string

or

dimvic\HCaptcha::getHiddenInput(?string $siteKey = null): string

3. Validate the result

dimvic\HCaptcha::validate(?string $token = null, ?string $remoteIp = null, ?string $secret = null): bool

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages