Larry
Administrators-
Posts
5413 -
Joined
-
Last visited
-
Days Won
155
Everything posted by Larry
-
Chapter 5 add_pdf.php
Larry replied to Jacques's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
You could do an isset($_FILES['mp4']['tmp_name']) first or just use the error suppression operator on the is_uploaded_file(). -
This error is the cause of all, or most, of your problems: Warning: include(C:/xampp/htdocs/PHP/Chapter13/mysqli_connect.php): failed to open stream: No such file or directory in C:\xampp\htdocs\PHP\Chapter 13\add_quote.php on line 23 Your reference to include mysqli_connect.php from add_quote.php is incorrect based upon how the two files are found on the server.
- 1 reply
-
- chapter13
- failed to open stream
-
(and 1 more)
Tagged with:
-
Ah, no, not exactly. The semicolon there terminates the line of PHP code. What I'm saying is you don't need to do this: $q = "SELECT user_id FROM users WHERE (email='$e' AND pass=SHA1('$p'));"; so that the query being run from the PHP script becomes SELECT user_id FROM users WHERE (email='$e' AND pass=SHA1('$p'));
-
Chapter 5 add_pdf.php
Larry replied to Jacques's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
My guess would be the file isn't being uploaded. How big is the .mov file you're testing with? And have you checked your server settings related to handling uploads (such as the max POST size)? -
Ah, okay. So you're only having this problem when you click submit to update the information? If so, I think that's because of the extra spaces around the stored value here: value=" '. $id .' " If you look at the HTML source of the page you should see the value stored as " 1 ". I wouldn't think that would cause this problem but I suspect it is.
-
Okay, so fundamentally the users table should identify the user and allow them to login (i.e., store login credentials). I wouldn't assign a single type in the users table b/c users don't have a single type in your scenario; they're type is defined by context. If you need to do something for or with a group of people--email all the parents, create teacher-specific pages--then you'll want to have an easy way to identify "is a teacher" or "is a parent" (but without limiting a user to being just one thing). My inclination would be to create three 1/0 TINYINTs: student, teacher, parent. A student would likely be 1, 0, 0 for those columns whereas a teacher would likely be 0, 1, 0 or 0, 1, 1. Using this approach you have flexibility as to how you refer to people or access lists of groups.
-
More information is needed to answer this. Can the users log into the site? I presume a teacher could also be a parent but can a parent or a teacher also be a student? In general, the user as a concept is a way of identifying a person. A user may also be a way to identify functionality (e.g., log in). But the user's type in your case may not be a static, singular thing but rather be a description of the relationship that user has to another user (e.g., teacher A may teach student B but also be a parent to student C).
-
SQL Problems
Larry replied to olaoyesunday's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
Make sure you create the users table before you create the orders table. -
SQL Problems
Larry replied to olaoyesunday's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
You're using single quotes when those should be backticks. -
SEO Keywords
Larry replied to olaoyesunday's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
Thanks for the nice words! As for #1, the code would be essentially the same as that creating the page titles (e.g., in browse.php and then header. html), just populating the META instead of the TITLE. -
Thanks for the interest in more books! Much appreciated! The "PHP Advanced" book would be the logical one after "PHP & MySQL". Or the e-commerce book that Necuima recommended.
- 9 replies
-
- 1
-
- php and images
- php and pdf
-
(and 2 more)
Tagged with:
-
SEO Keywords
Larry replied to olaoyesunday's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
1) You'd store the keywords in the database along with the product info. Then you'd retrieve the product details before including the header file, making those keywords available to the header file to put in a META tag. 2) You'd need to track the user's viewing history and then you can pull from there. So when a user views a product, that stores the product ID, user identifier, and timestamp in a table. When that same user identifier appears, you can pull the info from that table by date desc order. -
Sorry for the delay; I had to reinstall XAMPP on Windows to test this out. I suspect the issue you're having is because you haven't connected Mercury to the Internet at large. In other words, Mercury needs an SMTP server to work with. This is normally your local ISP or something like smtp.google.com (if you have a Gmail account). Have you done that? This page is pretty good, by the way: https://www.open-emr.org/wiki/index.php/Mercury_Mail_Configuration_in_Windows
- 4 replies
-
- sending email (example 8.10)
- xampp
-
(and 1 more)
Tagged with:
-
Ah, great! Glad you're making progress and thanks for letting us know! Just to be clear, you should never mix procedural and OOP approaches like that as you won't necessarily get the errror messages, let alone the results, you're looking for. As for your question, if a query must affect one or more rows, than checking for that is perfect. But if a query won't necessarily affect multiple rows than you can confirm that it worked--or that it didn't fail--by either checking the truthiness of the query result or by checking for the presence of an error.