0

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?

4
  • do a view source. if you see <?php in there, then your server is broken Commented Dec 2, 2013 at 18:55
  • 3
    "I am trying to pull a single variable ($Stouty447) from the Select.php file into my rank.html file." -- This wouldn't work. The file extension must be .php (unless you use some AddHandler magic with .htaccess). Commented Dec 2, 2013 at 18:56
  • Second code writes a string not your variable. You should write the first code and change your rank.html to a PHP page. Commented Dec 2, 2013 at 18:58
  • @MahanGM, second one is also a variable (if it is defined). But the line should contain a ;. Commented Dec 2, 2013 at 18:59

1 Answer 1

12

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.