moveit124 moveit124 - 1 year ago 85
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
from the Select.php file into my rank.html file.

I have tried:

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

It outputs
on my webpage.

I have also tried:

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

This outputs

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

Answer Source

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