-
passing id from function to another in php?
over 1 year ago
-
over 1 year ago
Hello Nasiya,
I just go through your code and i realized that you have two different functions on different pages. If you want to call any function then it should include in current page. If you are calling any function in other page then you can store return values of that function in cookie or in session. If you define both function in different files and include these functions in third file then you can use global variable as well to pass the values.
Thank You
Deepak Verma
-
-
9 months ago
first rows of both files must be:
1. <?php
2. session_start()
than you can use $_SESSION["id"] = $id; from function 1 (in function 1)
in second function $id = $_SESSION["id"]; or you can use POST (same as GET but invisible in url adress) -
2 Answer(s)