1 (edited by 2013-05-26 17:31:59)

Topic: php code for captcha isnt working?

my problem is the following thing this time:

i included an captcha picture..everything is alright..
but then i cant post comments anymore and get an blanco site..
CuteNews told me about this code i shall put on the page where my cutenews is shown..
at the beginning of the site,before any other code..
But when i do this,my whole cute news dissapears..
cant make it work...

(checked this info php thing and it says: GD Support     enabled )...
shouldnt it work then?
i also tried to put this code into different positions..nothing works,whenever this code is somewhere on the page..
my cutenews isnt shown anymore..

Re: php code for captcha isnt working?

What code did you add to the top of the page?
Link to site is always useful.

Try adding

error_reporting(E_ALL);

just below <?php in the file and see if it gives you any errors. Error messages are our friends.

I reckon the captcha uses sessions or cookies and they can only be set when there has been no output at all. This means no whitespace either, so please ensure that "<?php" is at the very top of your file and that there is not any of the following before: a new line, a tab or a space.

Re: php code for captcha isnt working?

What code did you add to the top of the page?
Link to site is always useful.

Try adding

error_reporting(E_ALL);

just below <?php in the file and see if it gives you any errors. Error messages are our friends.

I reckon the captcha uses sessions or cookies and they can only be set when there has been no output at all. This means no whitespace either, so please ensure that "<?php" is at the very top of your file and that there is not any of the following before: a new line, a tab or a space.

thanks a lot.
I just figured out how to put it..
Even though i dont know how or what i did lol..
I am using this code:

<?php require_once('cutenews/captcha/php-captcha.inc.php');
$lang = 'deutsch';
$number = "2";
$template = "AzureMaerz1";
include("cutenews/show_news.php");
?>

it is at the beginning of the php file.The very top! nothing is before it,it starts out with this < from the code.
I changed the order many times of all those things..finally it worked..
Even though the template loads from time to time a while,till it works..
so i have an unstyled news text with avatar from time to time for a while before this changes..Not sure why..

Now the comment system works again^^ With capcha. Thanks a lot

4 (edited by 2013-05-27 17:19:31)

Re: php code for captcha isnt working?

Oh, you're using UTF-8 CuteNews! The code is right and I'm glad your issue is over for the most part. When style elements load slowly, it can mean either
a) the browser has to wait a while to get the data (e.g. PHP is processing the templates really slowly, the server is sending back files really slowly, ...), or
b) mark-up errors are confusing the browser and it takes it some time until it has decided how to work it out. (I'm not exactly sure on the specifics, as you can tell from this pseudo-explanation, haha, but I have observed a few times that weird mark-up doesn't help a website in things performance. Not that I'm calling your mark-up weird! Haha)

Either way, take care! https://cutephp.com/forum/style_emoticons/default/wink.gif