nobra Posted October 21, 2019 Share Posted October 21, 2019 Hi, I am trying to figure out problem with header.html (Script 17.1). When i run the script, instead of links like Home, Forum Home, New Thread....i see ' . $words['home'] . ' '. $words['forum_home'] .' ..etc. My first impression was i typed something wrong. I replaced my file with file code download from the forum site but the problem is still present. I appreciate any help! Thanks! Link to comment Share on other sites More sharing options...
Larry Posted October 21, 2019 Share Posted October 21, 2019 What do you mean by "when you run the script"? What script are you running? Or, better yet, what URL are you using when you see that result? Link to comment Share on other sites More sharing options...
nobra Posted October 21, 2019 Author Share Posted October 21, 2019 localhost/includes/header.html Thanks! Link to comment Share on other sites More sharing options...
Larry Posted October 22, 2019 Share Posted October 22, 2019 Okay, that makes sense. If you're running an HTML script directly, then PHP code in that script won't be executed. You should instead be running the PHP script that includes the header file. Link to comment Share on other sites More sharing options...
nobra Posted October 22, 2019 Author Share Posted October 22, 2019 Thanks! Just one more questions regarding this script...header.html includes line: require('../mysqli_connect.php'); I presume this line will point to the mysqli_connect.php file, that is, per your safety recommendations, located outside web directory. if header.html file is located on my PC in C:/xampp/htdocs/includes folder, and htdocs is my web directory, mysqli_connect.php file should be located in xampp folder (two levels up from includes folder)? Do I need to change script line from ../mysqli_connect.php to ../../mysqli_connect.php? Appreciate your help very much! Link to comment Share on other sites More sharing options...
Larry Posted October 22, 2019 Share Posted October 22, 2019 The header.html file is going to be included from another script, so the reference to mysqli_connect.php needs to be correct relative to that parent script. That parent script should be in the htdocs folder, so ../mysqli_connect.php should be correct (if it's in the xampp folder). Link to comment Share on other sites More sharing options...
nobra Posted October 22, 2019 Author Share Posted October 22, 2019 Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts