Set a $_GET value |
PHP Code: localhost?foo=bar I encountered a loop because I couldn't update the $_GET parameters during the same request. PHP Code: # Solution? Is this possible?
Why change the GET parameter in the process? It is better to manipulate the variable $foo = $_GET[foo]
That's right, Request knows nothing about the new Get, Post data because the object is created once when the page loads
Simple CI 4 project for beginners codeigniter-expenses
You should not change the $_GET or the GET parameter in the request.
Why do you need to change it? (05-15-2024, 07:18 PM)kenjis Wrote: You should not change the $_GET or the GET parameter in the request. Why, why not? If it is possible in basic PHP then it seems to be a allowed way of working. It's old code, but it works. Now I need to use the basic, non-CI4-way, $_GET['foo'] to get the updated value. The other possible solution would be redirect to the same URI with updated params, but that's seems to be a overkill. Sure, It's better to to manipulate the variable $foo, but I thought the request could be updated with the new Get.
If someone has done this before, it doesn't mean it's right.
PHP does not remember data between updates. There is no reason to change GET. Use a different variable
Simple CI 4 project for beginners codeigniter-expenses
|
Welcome Guest, Not a member yet? Register Sign In |