You are here: Re: setcookie() or header() « All PHP « IT news, forums, messages
Re: setcookie() or header()

Posted by Steve on 10/06/06 13:50

you've already posted this question. you've gotten several responses.

DON'T USE COOKIES.

instead use $_SESSION

problem solved.


"Frits van Leeuwen" <Frits.vanLeeuwen@nospam.nl> wrote in message
news:51702$45261c15$c2ab6db8$30066@news2.tudelft.nl...
| Hello everyone,
| I try to use setcookie() or header().
| I need a cookie. but when I use setcookie() with header() the cookie will
| not set.
| When I use setcookie() without header() , the cookie will set but I do not
| have a redirection back to index.php.
| I saw at internet, you can use header() within set-cookie. I try some
thing.
| But it does not work.
| who can help me?
|
| <?php
| unset($_COOKIE[LeeuwendeelTaal]);
| switch ($_GET[ln])
| { // taal keuze
|
| case 'NL': // Nederlands
| $language = "NL";
| break;
|
| case 'EN': // Engels
| $language = "EN";
| break;
|
| default: // geen taalkeuze gemaakt.
| $language = "";
| break;
|
| }
| header("Set-Cookie: LeeuwendeelTaal=$language; expires=time()+3600*24");
//
| 1 dag
| header("Location: /index.php");
| exit;
| ?>
|
|

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация