moveit124 moveit124 - 6 months ago 29
PHP Question

PHP - include variables

I have two files on my hosting website:


  • Select.php - Contains variables and gets information from a database and works perfectly, I am able to have it write out all the variables.

  • rank.html - generic website



I am trying to pull a single variable
$Stouty447
from the Select.php file into my rank.html file.

I have tried:

<?php include 'Select.php';
echo $Stouty447;
?>


It outputs
$Stouty447;?>
on my webpage.

I have also tried:

<?php include 'Select.php' echo "$Stouty447";?>


This outputs
"$Stouty447";?>


Any ideas on where I should go from here or what I should do?

Answer

.html files normally will not be parsed by PHP without modifying the webserver configuration. Try renaming it to rank.php.