Hussain,
I created 2 small scripts: a.php and b.php
a.php is:
PHP Code:
<?
$CookieExpires = time() + 3600;
$CookieName = "TopicID" . '1';
setcookie("$CookieName", "true", $CookieExpires);
echo("setcookie(\"$CookieName\", \"true\", $CookieExpires);");
echo("<br>");
echo("The value of the cookie TopicID1 is " . $HTTP_COOKIE_VARS["TopicID1"]);
?>
<a href="b.php">bbb</a>
and b.php (or your temp.php) is
PHP Code:
<html>
<head>
<title>Testing</title>
</head>
<body><table border="1" width="100%">
<tr>
<td>
<?
$TopicID = 1;
$CookieName = "TopicID" . $TopicID;
echo($TopicID1);
echo($HTTP_COOKIE_VARS["$CookieName"]);
echo("<br>Hope this works!");
?>
</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
<?
//echo "dd". $TopicID1;
//echo ($HTTP_COOKIE_VARS["TopicID1"]);
?>
and here's the output:
setcookie("TopicID1", "true", 1004780755);
The value of the cookie TopicID1 is true bbb
Click on bbb link and it gives this:
truetrue
Hope this works!
Try the above scripts and see if you have the same result.
Bookmarks