Jump to content

Recommended Posts

Hi,

Yes, you can create a list of master variables.

Say you set up a file called mastervariables.php and put it in the same folder as me.php.

Then list your variables in there eg

<?php
$variable1="hello";
$variable2="hello2";
?>

Then on me.php, simply include the file with the following code:

<?php
include ("mastervariables.php");
?>

Hope that helps

Mark
Link to comment
https://forums.phpfreaks.com/topic/3949-variables-and-values/#findComment-13712
Share on other sites

[!--quoteo(post=351134:date=Mar 2 2006, 06:22 PM:name=markduce)--][div class=\'quotetop\']QUOTE(markduce @ Mar 2 2006, 06:22 PM) [snapback]351134[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Hi,

Yes, you can create a list of master variables.

Say you set up a file called mastervariables.php and put it in the same folder as me.php.

Then list your variables in there eg

<?php
$variable1="hello";
$variable2="hello2";
?>

Then on me.php, simply include the file with the following code:

<?php
include ("mastervariables.php");
?>

Hope that helps

Mark
[/quote]

So once I add:
<?php
include ("mastervariables.php");
?>

me.php will use those variables?

If I want to add variables in a different directory I'll just have to do this:
<?php
include ("/newdirectory/mastervariables.php");
?>

Correct?

Thanks in advance.
Link to comment
https://forums.phpfreaks.com/topic/3949-variables-and-values/#findComment-13723
Share on other sites

[!--quoteo(post=351145:date=Mar 2 2006, 06:47 PM:name=pneudralics)--][div class=\'quotetop\']QUOTE(pneudralics @ Mar 2 2006, 06:47 PM) [snapback]351145[/snapback][/div][div class=\'quotemain\'][!--quotec--]
So once I add:
<?php
include ("mastervariables.php");
?>

me.php will use those variables?

If I want to add variables in a different directory I'll just have to do this:
<?php
include ("/newdirectory/mastervariables.php");
?>

Correct?

Thanks in advance.
[/quote]
That would work :)
Link to comment
https://forums.phpfreaks.com/topic/3949-variables-and-values/#findComment-13730
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.