SV: SV: [PHP] Passing a variable invisibly via a href?
| From: | Daniel Alsén | Date: | Tue, 02 Apr 2002 15:28:41 +0000 |
| Subject: | SV: SV: [PHP] Passing a variable invisibly via a href? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-91159@lists.php.net to get a copy of this message | ||
> Yes, there is a way to do it without using any forms. I may be able to
> help you better if you could show me the relevant code -- I'm not sure
> if what I have in mind is really applicable to what you want to do.
It´s not really advanced:
session_start();
session_register('text_size');
if ($change == "inc") {
$text_size++;
}
elseif ($change == "dec") {
$text_size--;
}
I use the variable $change to set the text size in my stylesheet:
if (isset($text_size)) {echo $text_size;} else {echo "10"; $text_size = 10;}
And i set the variable via a link:
<a href="<? echo $PHP_SELF; ?>?change=inc"> (or change=dec)
Now - i don´t want the variable to be visible. And i would prefer if the
variable didn´t get set every time someone hit reload.
Or am i attacking this changing-text-size-thingy the wrong way?
- Daniel