Jump to content
Larry Ullman's Book Forums

Recommended Posts

Hi All,

 

Firstly, I wanted to compliment this amazing book. It is a daunting thing learning php, MySQL, dhtml and javascript all at once, but this book makes it come together pretty fluently. My biggest error was that I underestimated it from the outset, grouping "web development" in with the lesser forms of programming. My apologies, I stand corrected and awed.

 

I’ve been working pretty successfully throughout the book, but now suddenly in Chapter 11, making the login functions, I’m having difficulties regarding where the scripts are saved.

Thus far, the reusable scripts such as ‘header’ have mostly been included in the ‘includes’ directory. But in this chapter, when I put the login_page.inc.php itself in the ‘includes’ directory, the page can’t find various other files that I’m calling on, ‘header.html’ being the first example.

 

Due to this, I had to rewrite the header call (within login_page.inc.php) to get rid of the ‘‘includes/’ portion of this path (‘includes/header.html’), because with the login page also being in the includes directory, it’s now looking for this file in ‘includes/includes/header.html’.

 

But then having removed the includes prefix, the generic, shared header calls the css script, and links to the other pages such as ‘viewusers’, and now these links no longer work. Putting the login page inside ‘includes’ seems to have broken the harmonious simplicity of the site :blink:

 

The tip on page 330 touches upon this, but says “the code works because this script will be included by pages within the main directory...”, but this is not the case.

 

Question: If this should work but doesn’t, where do I begin my troubleshooting?

(I’m working locally using WAMP server.)

 

Cheers,

 

Chris

Link to comment
Share on other sites

Thanks for the nice words. The login_page.inc.php file isn't run directly, but loaded from another page within the main directory. This is why references within login_page.inc.php include the "includes" folder, and, in fact, need that in order to work properly. Perhaps you're trying to run login_page.inc.php directly?

Link to comment
Share on other sites

 Share

×
×
  • Create New...