Need help setting cookies with multiple value

Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress.

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 5 years ago.

Improve this question

im having troubles with setting cookies in my website (since its the first time using them). Basicly i have this form on a article page:

<form method="POST" action="">
    <input type="submit" value="<?php echo $id ?>"  name="commentData">
</form>

and with this function i can store the id in my cookie:

if (isset($_POST['commentData'])) {
        $cookie_value = $_POST["commentData"];
        $cookie_name = "saved_articles";
        setcookie($cookie_name, $cookie_value, time() + 600, '/');
    }

Now i need to be able to store multiple ids in my cookies so i can loop on my 'saved articles' page. Currently it always override the value. Any help would be greatly appreciated

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745205401a4616570.html

相关推荐

  • Need help setting cookies with multiple value

    Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress.

    13小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信