Jump to content

PHP isn't including variables


SJames

Recommended Posts

I am having a problem with include() not taking any variables. For example, if I have the following two files, it won't print the variable.

 

one.php

 

<?php
          $a = "Text";
?>

two.php

 

<?php
          include "one.php";
          print $a;
?>

 

The second file doesn't print "Text", it just remains blank.

Link to comment
https://forums.phpfreaks.com/topic/66731-php-isnt-including-variables/
Share on other sites

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.