我想知道是否有人能发现我的 php 代码有什么问题,用于设置 cookie。谢谢!
$expire=time()+60*60*24*30;
$selected_image = $_GET["img"];
$selected_caption = $_GET["caption"];
$selected_color = $_GET["color"];
switch ($selected_image){
case:"img1"
setcookie("img1_caption", $selected_caption, $expire);
setcookie("img1_color", $selected_color, $expire);
break;
case:"img2"
setcookie("img2_caption", $selected_caption, $expire);
setcookie("img2_color", $selected_color, $expire);
break;
case:"img3"
setcookie("img3_caption", $selected_caption, $expire);
setcookie("img3_color", $selected_color, $expire);
break;
case:"img4"
setcookie("img4_caption", $selected_caption, $expire);
setcookie("img4_color", $selected_color, $expire);
break;
}