passing parameters on a file in a different directory

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
User avatar
Ju-Pao
Forum Newbie
Posts: 9
Joined: Wed Feb 21, 2007 3:44 am

passing parameters on a file in a different directory

Post by Ju-Pao »

How can i pass a parameter to a function in a class from a different directory?

For example i have mycode.php in the /php/path/ directory.

I want to pass my $var variable to getdata.class into the function recievevar() in the /class/path/ directory.

Thank you for your notice

^__^
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

The directory the file is in does not matter. You need to include both the mycode.php and getdata.class files, and create a getdata object. Then you can pass parameters to functions or object methods.
(#10850)
User avatar
Ju-Pao
Forum Newbie
Posts: 9
Joined: Wed Feb 21, 2007 3:44 am

Post by Ju-Pao »

how can i create an object? are there any tutorials that you can suggest?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

(#10850)
Post Reply