using variables from another php file...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
biggie
Forum Newbie
Posts: 8
Joined: Fri May 26, 2006 11:57 pm

using variables from another php file...

Post by biggie »

long story short...
I have a html file that contains a simple form that among other things has 3 selects..for day, month and year....the form's action is a php file....in that php file the 3 selects are joined under one variable...something like $date="$year -$month - $day"..something like that. anyway how do I use this variable(that is contained in file1.php) in another php file? I don't know if u are folowing me here...simply said..I want to use a variable that is found in another php file. how can I "extract" it from there or...?

10x
LiveFree
Forum Contributor
Posts: 258
Joined: Tue Dec 06, 2005 5:34 pm
Location: W-Town

Post by LiveFree »

Code: Select all

include('some_file_with_the_vars.php');
Include the file before you start using the vars or you'll get warnings
Post Reply