i have a problem in displaying the values of a cookie dynamically
code goes as...
include("connect.php");//database connection file
echo $_COOKIE'];

// how do i display the value of cookie every time... it is over written....
i have tried it with using array..
in short i want to display multiple values of single cookie..
value must no overwrite... coz i don't know how many times the user clicks the likn...

This example is taken from PHP.net > setcookie

// set the cookies
setcookie("cookie[three]", "cookiethree");
setcookie("cookie[two]", "cookietwo");
setcookie("cookie[one]", "cookieone");

// after the page reloads, print them out
if (isset($_COOKIE['cookie'])) {
    foreach ($_COOKIE['cookie'] as $name => $value) {
        $name = htmlspecialchars($name);
        $value = htmlspecialchars($value);
        echo "$name : $value <br />\n";

but this sets three cookies...
in my site... the creation of cookies depends upon the click on <a> of user....
co how could i know how many times he clicks....

and previous values also should be displayed..
plz. help...

The code you posted originally will create multiple cookies. What are you trying to do? Store a history of what content user's have looked at?

If so, why not store either a serialised array, or a comma separated list?

$data = serialize(array(1, 2, 3, 4);
setcookie('history', $data, ...);

$data = implode(',', array(1, 2, 3, 4));
setcookie('history', $data, ...);

i have a web page that shows list of products with images(from database)

so when the user clicks on any of the image a new page with price and description of that product is open(i did this by transferring the id of clicked image to next page)

and again when the user click on to finally shop that product.. i had passed again that id to next page.. and print it with the use of array of cookie

but when the user performs the same process again for other product...

the previous cookie is overwritten...