can someone tell me how i pass variables from one .php page to another, found documentation that mentions sessions and another that mentions $GLOBALS but nether are very clear and i'm a bit confused.
Well there are a couple answers to this. If you are using a form with an action of another PHP page they are passed automatically. If not, you could pass them in the URL, like mypage.php?var1=value1&var2=value2 etc.
$b = 2;
Function Sum () {
$GLOBALS["b"];
}
Sum ();
echo $b;
that uses globals, trouble is cant call sum from the other page? if not this how do i pass the variable in the url (rather not do this as i have lots of variables to pass)
In that case I believe globals is just making $b available to the function which it isn't by default.
Maybe you could describe more of what you are trying to accomplish. There are a number of ways you could do it - sessions and/or cookies, for starters.
ok i am doing some experiments with imagegif(); where i am creating triangles from six variables which are set randomly, each variable corresponds to the x or y of a triangle point, then i am calculating the centre of the triangle to floodfill it.
trouble is my floodfill messes up about once in every ten refreshes of the page so i am trying to debug the thing by echoing my variables to the page, cant do this because for some reason the echo does not work in the same page as the imagegif(); probably to do with the header! so... i am tring to echo my variables on another .php page which is displaying the image with <img src="image.php"> but i need to know how to pull them from the first.
get me? its actually not as hard to do as my bad explanation is to understand.
Bookmarks