0
Identify the error in the following code php
<?php $value = "John"; <b> setcookie ("user", $value, time() + (86400 * 30), "/") </b> ; if(isset($_COOKIE['user'])) { echo "Value is: ".$_COOKIE['user']; } //Outputs "Value is: John" ?>
5 Antworten
0
remove <b> and </b>
0
i did it no answer too
0
?
0
Warning: Cannot modify header information - headers already sent by (output started at ..\Playground\:1) in ..\Playground\ PHP Warning: Cannot modify header information - headers already sent by (output started at ..\Playground\:1) in ..\Playground\. the following mssage displayed
0
Okay I tried it and it looks like you cannot use Cookies in sololearn.
To use setcookie, make sure no headers are sent before (No HTML before, no echo before, no include before).