setting a cookie in php

Posted by Jacksta on Stack Overflow See other posts from Stack Overflow or by Jacksta
Published on 2010-04-20T02:06:20Z Indexed on 2010/04/20 2:13 UTC
Read the original article Hit count: 276

Filed under:
|
|
|

I am trying to set a cookie, whas wrong with this as I am getting an error.

Warning: setcookie() expects parameter 3 to be long, string given in /home/admin/domains/domain.com.au/public_html/setcookie.php on line 6

<?php
$cookie_name = "test_cookie";
$cookie_value = "test_string";
$cookie_expire = "time()+86400";
$cookie_domain = "localhost";
setcookie($cookie_name, $cookis_value, $cookie_expire, "/", $cookie_domain, 0);
?>
<HTM>
<HEAD>
</HEAD>
<BODY>
<h1>cookie mmmmmmm</h1>
</BODY>
</HTML>

© Stack Overflow or respective owner

Related posts about php

Related posts about php5