Larry
Administrators-
Posts
5413 -
Joined
-
Last visited
-
Days Won
155
Everything posted by Larry
-
I think we're not quite following each other here. Let's look at this logically... 1. header.html uses if (isset($page_title)) { so $page_title MUST be set in the file that includes the header and before the header is included. 2. The code you posted above does exactly that, which is great. $page_title = $words['signin']; 3. That code only works if $words is defined. There's nothing in the code you've posted that defines $words. Does your config.inc.php or MYSQL script do that? Again, this is a pretty basic logic issue and you may find that if you talk it out you might realize where the problem is.
-
Ah, thanks for explaining. Unfortunately I'm not a pro-debugger when it comes to Bootstrap (or CSS) so it's not obvious to me what the cause is. In such situations I'd normally find a working example some place, copy that in, and then replace the key bit with my PHP code.
- 12 replies
-
How is the code you're currently using not working? What debugging steps have you taken and what were the results?
- 12 replies
-
combining pages for DBM
Larry replied to possowski's topic in PHP for the Web: Visual QuickStart Guide (5th Edition)
Good question! The main reason is the logic would be really complicated and prone to have bugs. It definitely not an approach I'd recommend for beginners. If anything on a more advanced level, I might be inclined to make it more modular: for example, put the form and form validation in one or two separate pages then included by the primary pages. Thanks for the great question! -
Ch 11 clearing the text file
Larry replied to possowski's topic in PHP for the Web: Visual QuickStart Guide (5th Edition)
It's not clear to me what function you're referring to, but I'm pretty certain the answer would be "no". The easiest way to clear the contents of a text file would be to delete the text file and then recreate it. -
help with page 177
Larry replied to kravmaguy's topic in PHP for the Web: Visual QuickStart Guide (5th Edition)
Yep! After the loop, $book refers to the last item in the $books array. That should not be the case! I wouldn't think it'd be the case, anyway. Just to be clear, you may want to add headings before doing each print_r() so it's absolutely clear what's going on. It should print the last key, yes, but that value should not be a book. Yes, that should be correct. Aside from a bit of confusion, in general, the last value assigned to a variable in the loop is still assigned to that variable after the loop, which is what you're seeing here. -
javascript link stopped working
Larry replied to abigail's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
Yes, it looks like your site doesn't include those JavaScript links. I don't know if that's a problem or not (it is a problem if your site needs that JavaScript). But it's pretty unusual to pull a JS file from another site. -
javascript link stopped working
Larry replied to abigail's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
If I try to load http://www.the-tree-of-life.com/lib/jquery/jquery.js directly in my browser I get a 404. Same for the core.js script. It looks like those files have been moved. You should talk to whomever gave you those links to use to find out what links you should use now instead. -
I'm not entirely sure I follow what's going on or being asked here, but... 4. I don't know what it means to "call from an HTML file". You can load any HTML file anywhere in a browser but to run an HTML file through a URL, it has to be within Apache's document root. An HTML file cannot include a PHP script. 5. That sounds like you're observing a file transfer session, where they've logged into a remote server and then they drag-and-drop to transfer files. Apache, HTML, and PHP don't come into play here (i.e., you can file transfer any type of file). 6. That is correct. 7. Again, not sure what "call HTML" means but if you're using the web server application (e.g., Apache), to load a file through a URL it has to be in the web server document root.
-
Chapter 11, Files And Directories
Larry replied to shanna's topic in PHP for the Web: Visual QuickStart Guide (5th Edition)
Cool. Glad it's working now and thanks for letting us know! -
Chapter 11, Files And Directories
Larry replied to shanna's topic in PHP for the Web: Visual QuickStart Guide (5th Edition)
Hmm...this isn't obvious to me. A guess is that "c" vs. "C" may be a problem, but that's just a blind guess. I have no idea if that's a problem for Windows or not. My second guess is that initial space in the file name is causing a problem. Make sure that move_uploaded_file() code is on one line.