In order to pass it to the next page, you need to add it to the url that points to the next page.
Let us say, your current page containing cellnumber is called "myform.php" and you want to pass it to "myaction.php".
In "myform.php", you put a line with "href" element like this:
Code:
<a href="myaction.php?param=value">go to action page</a>
The param is any string you want, used to identify the parameter in the next page ("myaction.php"). So for your example, you put CELLNUMBER value substituting "value".
Now in the "myaction.php" page, you get the value by using:
Code:
$_GET["param"];
Of course, if you used other string other than param, simply replaced "param" with the text you used in "myform.php"
In order to pass it to the next page, you need to add it to the url that points to the next page.
Let us say, your current page containing cellnumber is called "myform.php" and you want to pass it to "myaction.php".
In "myform.php", you put a line with "href" element like this:
Code:
<a href="myaction.php?param=value">go to action page</a>
The param is any string you want, used to identify the parameter in the next page ("myaction.php"). So for your example, you put CELLNUMBER value substituting "value".
Now in the "myaction.php" page, you get the value by using:
Code:
$_GET["param"];
Of course, if you used other string other than param, simply replaced "param" with the text you used in "myform.php"
I am not familiar with the PHP structure you are using. I assume you are on some sort of framework. What I explained above is a concept, for implementation, you need to check with your framework.
Other alternatives are to save it as a session variable, or add it to a hidden form field (in case you are not locked down to it being a GET parameter due to interfacing with pre-existing code?).
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Other alternatives are to save it as a session variable, or add it to a hidden form field (in case you are not locked down to it being a GET parameter due to interfacing with pre-existing code?).
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
It can be whatever you want it to be. $_SESSION is an array, to which you can add any number of elements -- even other arrays. It is "super-global", so you can access it just like you do $_GET or $_POST -- as long as you do session_start() first (and before any output of any type is sent to the browser).
If you are unfamiliar with PHP sessions, definitely spend some time reading up on them, as they are a very useful tool for persisting data across multiple page requests.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks