Hi,
In a .php page, I am making a list of some materials which have in formation in MySQL. And there is a link which calls another .php file with some parameters. And this called .php file creates a parameter that covers some value, and I want to receive it without going to this called page.
Is it possible?
If it, how can I have this parameter?
Receive a parameter from another file
Moderator: General Moderators
-
mustafamisir
- Forum Newbie
- Posts: 23
- Joined: Wed Jun 22, 2005 1:00 pm
- Contact:
I'm a little unclear. You have two files (let's say A and B) - A has values it's pulled from MySQL. B generates some values as well. You want to be able to get variables and values from B, in A, without having to actually go to B.
Is that correct?
If so, require_once() may be what you need. That function opens and runs the required file inline.
Make sense?
Is that correct?
If so, require_once() may be what you need. That function opens and runs the required file inline.
Code: Select all
<?PHP
$first_var = 10;
?>Code: Select all
<?PHP
$second_var = 2;
require_once('example_page.php');
echo $second_var * $first_var;//will output '20';
?>Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
-
mustafamisir
- Forum Newbie
- Posts: 23
- Joined: Wed Jun 22, 2005 1:00 pm
- Contact: