Answer the question
In order to leave comments, you need to log in
How to save parameter for php?
Good afternoon. I'm just starting to learn php, but already now I'm faced with the following task:
Let's say there is an example.com page. In my project, it has design A. But if you add ?lite (example.com/?lite) to the address bar, the design changes to B.
One thing that worries me is that all links that are opened in design B lead to design A, because the lite parameter is missing at the end of the line.
Is it possible to put some kind of crutch, preferably using cookies? To remember this choice.
Sorry if the question is stupid or poorly worded.
I'm looking forward to the answers. Thank you.
Answer the question
In order to leave comments, you need to log in
Since the lite parameter does not matter in this case, but simply either it exists or it does not, then
if(isset($_GET['lite'])){
setcookie('lite ','true',time()+172800,"/");
$lite = true;
}
Sorry if the question is stupid or poorly worded.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question