php-windows Digest 28 Dec 2006 11:00:48 -0000 Issue 3097

Topics (messages 27331 through 27332):

RE:Mail always goes to junk folder.
        27331 by: Alex Powell

setcookie() not working - help!
        27332 by: Beraru Liviu

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
Hi Nii,

Probably this has been caused by the server being incorrectly configured to
send mail. There are many spam filters out there, but things to check:

* reverse DNS - I had this problem a while back, some clients weren't
receiving mail. It is important the server gives the correct DNS name on the
SMTP helo as the receiving server can look up from the reverse DNS.
* check www.dnsreport.com . This can point out other problems with mail
delivery.
* check the obvious - logs etc. It is possible that the headers are dodgy in
some way or something else is unusual.

Good luck and happy new year,

Alex

--- End Message ---
--- Begin Message ---
Hello,
  I am a newbie in php and have a problem with setting up a cookie.
  The code should just verify if the user's browser has a cookie from my site, 
and if there is one, then increase the counter file. If not, then the counter 
should not be increased.
   
  I have Xampp installed, the latest version, which means also php 5.
  But, when I test the script I get from the my server the following error 
message:
   
  Warning: Cannot modify header information - headers already sent by (output 
started at C:\Programme\xampp\htdocs\Laborator\index.php:5) in 
C:\Programme\xampp\htdocs\Laborator\index.php on line 55
   
  Line 55 is where stands the setcookie() method.
  I have no idea what is wrong and what this error message means.
   
  Could someone please help me?
   
  The code I wrote is this one:
   
   
  <?
$file="counter.txt";     
if (!file_exists($file)){
$ix=fopen($file, "w");
fwrite($ix, "0");
fclose($ix);
}
  $ix=fopen($file, "r");
$counter=fread($ix, 10);
fclose($ix);
  $cookie = $_COOKIE['cookie'];
     
if(!isset($cookie)){
                       //FOLLOWS LINE 55:
setcookie ("cookie" , "ok");
$counter++;
$ix=fopen($file, "w");
fwrite($ix, $counter);
fclose($ix);
}
     
$lung=strlen($counter);
$counter_grafic="";
for ($pos=0; $pos<$lung; $pos++){
$cifra=substr($counter, $pos, 1);
$counter_grafic.="<img src=\"img/cifre/$cifra.jpg\">";
}
?>
   
  Liviu Beraru

 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

--- End Message ---

Reply via email to