Re: Cookies do not work
| From: | Sjaak | Date: | Mon, 23 Sep 2002 09:56:53 +0000 |
| Subject: | Re: Cookies do not work | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-15953@lists.php.net to get a copy of this message | ||
Yo bro,
When i launch the file info.php with the following URL:
http://localhost/info.php i see the cookie.
When i launch the same file from my webserver:
http://www.website.com/info.php i get the message no
cookie find?
Please help me!
Thx in advance.
"Brother - Martin Bagge" <brother@lunarstorm.se> wrote in message
news:D3E25D35F0237348A30DF8C845C4E95D024E71D5@reddwarf.lunar.com...
> You cannot use the cookies in the same as you stated them.
>
> http://www.php.net/manual/en/function.setcookie.php
> see common pitfalls.
>
>
> You have to do it like: set cookie > new page to check the cookies.
>
> /brother
>
> > -----Original Message-----
> > From: Sjaak [mailto:sjaak000@zonnet.nl]
> > Sent: den 23 september 2002 09:15
> > To: php-windows@lists.php.net
> > Subject: [PHP-WIN] Cookies do not work
> >
> >
> > Dear all,
> >
> > I have a Windows2000 server with PHP & IIS5
> >
> > My customer has written the following script:
> >
> >
> >
> >
> > <?php
> > //Verbinding maken met de database
> > include("db/beheer/dbconnect.php");
> >
> > setcookie('test','Dit komt uit een
> > cookie!!',time(0)+3600,'/','',0);
> >
> >
> > echo "<br><table align='center'><tr><td><font
> >
> > size='+1'><b>Openingstijden:</b></font></td></tr></table><br>";
> >
> > $query = mysql_query ("SELECT * from openingstijden");
> >
> > echo "<table align='center' border='1'>";
> > echo
> >
> > "<tr><td><b>Nr.</b></td><td><b>Vestiging</b></td><td><b>Maanda
> > g</b></td><td>
> > </td></tr>";
> >
> > //$teller = 1;
> > while ($row = mysql_fetch_array ($query))
> > {
> > echo "<tr><td>".$teller."</td>";
> > echo "<td>";
> > if ($row['vestigingid'] == 1)
> > {
> > echo "Trio woonplaza / Profijtmeubel";
> > }
> > if ($row['vestigingid'] == 2)
> > {
> > echo "Trendhopper Druten";
> > }
> > if ($row['vestigingid'] == 3)
> > {
> > echo "Trendhopper Arnhem";
> > }
> > echo "</td>";
> >
> > echo "<td>van ".$row['maandagopen']." tot
> > ".$row['maandagsluiten']."</td>";
> > $teller = $teller+1;
> > echo "</tr>";
> > }
> > echo "</table>";
> >
> > if (empty($HTTP_COOKIE_VARS))
> > {
> > echo "<br><center><b>KAN GEEN COOKIE VINDEN
> > :-(</b></center>";
> > }
> > else
> > {
> > $cookie = $HTTP_COOKIE_VARS["test"];
> > echo "<br><center><b>COOKIE GEVONDEN!! inhoud =
> > ".$cookie."</b></center>";
> > }
> >
> > ?>
> >
> >
> > But when displaying we cannot get the cookie been displayed.
> > Also after
> > refresh the browser.
> >
> > Does anyone has an idea? Setting in my PHP.INI?
> >
> > Please help me!
> >
> > Cheers,
> > Jacco
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >