|
Posted by Rik on 09/12/06 10:49
Frits van Leeuwen wrote:
>>> I start index.php. There I click at a link. Then I start a file.
>>> With starting that file, I start a line for setting a cookie. After
>>> it, I
>>> like to go back (without a click) to index.php.
>>> So the cookie is set. but then...
>> Or alternatively in one file:
>>
>> index.php
>> <?php
>> if(isset($_REQUEST['cookie'])){
>> setcookie(//etc);
>> }
>> //rest of index.php
>> ?>
>> <a href="./index.php?cookie">Set a cookie</a>
>> or:
>> <form method="post" action="./index.php">
>> <input type="submit" name="cookie" value="Set a cookie">
>> </form>
> Thanks Rik,
> Can you explane the last example?
>
In the last example, the index.php itself will set a cookie if the GET or
POST array contains the named variable 'cookie'. No oher/intermediate files
required.
Grtz,
--
Rik Wasmus
Navigation:
[Reply to this message]
|