dapphp / securimage

PHP CAPTCHA Script
https://github.com/dapphp/securimage
BSD 2-Clause "Simplified" License
568 stars 190 forks source link

Problem with user pages #89

Closed girishpadia closed 4 years ago

girishpadia commented 5 years ago

Hello,

My user page begins with ~ key. For example https://myserver.com/~username. When I use securimage, the include URL automatically turns in https://myserver.com/username and ~ disappears from the URL. Therefore, all include files generates error "404 - Not found". How to resolve this issue? This is happening when securimage folder is outside of my document root.

dapphp commented 4 years ago

If you are using the Securimage::getCaptchaHtml() function, it's possible this is not guessing right.

But you can try to override it using the securimage_path option, or one of the more direct options:

<?php

$options = [
    'show_image_url' => '/~username/securimage/securimage_show.php',
];

echo Securimage::getCaptchaHtml($options);

There are a lot of options for fine tuning the various parts of the output. I hope that helps!