hi.
i have a problem with captcha code in my multiblog website i using this cod for captcha but this cod only working in my index site and not working in blogs i can know this problem creating for session_start(); this item dont have any problem with my home page but not working in user blogs .
example :
http://example.com ====> nice working captcah
http://123.example.com ====> not working
http://abc.example.com ====> not working
http://efgh123.exapmle.com ====> not working
my cod :
<?php
session_start();
$cap = $_POST['txtcap'];
if(isset($cap))
{
if(md5( $cap)== $_SESSION['key'] )
{
//other codes
}
else
{
echo 'error';
}
?>
my captcha creator codes :
<?php
session_start();
$str=substr( md5( microtime() * time()),1,5);
$captcha = imagecreatefrompng("http://aytablog.com/buy/capchabg.png");
//get color
$black=imagecolorallocate($captcha,0,0,0);
$line=imagecolorallocate($captcha,233,239,239);
//draw line in pic
imageline($captcha,0,0,39,29,$line);
imageline($captcha,40,0,64,29,$line);
imagestring($captcha,5,20 ,10,$str,$black);
$_SESSION['key']=md5( $str);
("Content-type: image/png");
imagepng($captcha);
?>
please help me for solving this problem .
thank you.