Jump to content
Larry Ullman's Book Forums

Recommended Posts

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!

Script 17.1.jpg

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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). 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...