Is it possible to send a variable to another page without using a form?
For example....
send.php
Code: Select all
<?php
$me =1;
echo $me;
?>
Code: Select all
$hi = $me + 3;
echo $hi;
Moderator: General Moderators
Code: Select all
<?php
$me =1;
echo $me;
?>
Code: Select all
$hi = $me + 3;
echo $hi;
Code: Select all
$me = 3 + 4;
<a href="/receive.php?me=<?php echo $me ?>">Link</a>
Code: Select all
$me = $_GET['me']; //7
echo $me;
I have a page where I retrieve & display the quantity of an item from the DB. Then I have another page where I use the quantity to compute the total.tasairis wrote:Yes, it's possible. But what you do depends on why you need it.
An object only exists in one pageload. It'd be the same as any other PHP variable.jaceinla wrote:It would be OO, but I believe if send and receive can both extend the same class which holds the DB var value within it, they can then both retrieve it. Using a get and set method.