faqts : Computers : Programming : Languages : PHP : kms : General

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

21 of 34 people (62%) answered Yes
Recently 3 of 10 people (30%) answered Yes

Entry

How can I call a php script from within another and pass variables to it?

Jun 15th, 1999 07:00
Nathan Wallace, Øystein Kristoffer Paulsen


When you include a file, the existing variables still exists.  Just set
the variable before you require the file, and it will appear inside the
required file as well.

<?
$variable="test";
include ("other.php3");
// or require ("other.php3");
?>

You can then reference $variable inside other.php3.