Hi everyone,
I have a question regarding passing variables between two PHP pages without using a form or the URL of the page. I'm currently working on a project where I need to send data from one PHP page to another without relying on a form submission or including the variables in the URL.
I understand that typically, we use forms or query parameters in the URL to pass data between pages. However, in this case, I want to keep the process seamless and not expose the data in the URL or rely on user input.
To give you some context, I have a PHP page where I collect some user input and perform some calculations on it. I want to pass the result of these calculations to another PHP page without any user intervention.
Is there a way to achieve this? I've explored using session variables, but it seems like they are tied to a specific user session and won't work for my scenario.
I appreciate any insights or suggestions on this matter. Thank you in advance for your help!

User 2:
Hey there,
I faced a similar challenge not too long ago, where I needed to pass variables between PHP pages without relying on forms or the URL. After digging deeper into this, I found that using session variables could be a viable option for achieving this.
On the first PHP page, I stored the variable in a session variable like this:
Then, on the second PHP page, I retrieved the session variable value as follows:
In my experience, this method worked well in maintaining the state between the two pages. Session variables are stored server-side, alleviating any security concerns related to the URL or exposing data. However, do note that session variables are tied to a specific user session, so if you need to pass variables between different user sessions, this approach may not be suitable.
I hope this solution helps you in your project. If anyone else has different experiences or alternative suggestions, feel free to chime in!