Jump to content

Using variables created in an included file


Darkmatter5

Recommended Posts

Here's the config.php file.

 

<?php

    $game_title="DEFAULT TITLE";

    $admin_email="[email protected]";

    $url="http://www.nothing.com/";

?>

 

Now here's my page file.

 

<?php

  include_once('library/config.php');

?>

 

In the page file how can I display $game_title, $admin_email and $url?

Here's the config.php file.

 

<?php

    $game_title="DEFAULT TITLE";

    $admin_email="[email protected]";

    $url="http://www.nothing.com/";

?>

 

Now here's my page file.

 

<?php

  include_once('library/config.php');

?>

 

In the page file how can I display $game_title, $admin_email and $url?

 

echo $game_title;
echo $admin_email;
echo $url;

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.