Larry
-
Posts
5413 -
Joined
-
Last visited
-
Days Won
155
Posts posted by Larry
-
-
Then perhaps there's an error in your .htaccess file that prevents it from being parsed. Or perhaps the rules are working but they're not doing what you expect them to.
-
So if you will have a thought why would apache 2.2 reject to obey rewrite rules that i have defined in .htaccess file in root directory - that would be so much appreciated!
Apache would ignore .htaccess files if httpd.conf (the primary configuration file) isn't set to allow overrides (i.e., changes) within directories.
-
Hey Floydian. Always good to hear from you. Huge congrats on the weight loss. 145lbs? That's insane. I'm jealous of your ability to get to the gym. I've got so little time.
Thanks for the post and drop by any time! And keep up the good work (outs)!
-
Thanks, Floydian! Your check is in the mail!
-
well, I got brands.php to display images for items taken from database OK, my brands.php is in site root directory along with browse.php, everything seems to be working up to the moment when I am passing 'category' and 'id' to browse.php. This is for some reason do not work. I spent last 9 hrs trying to figure out why it is not working, could you (please,please,please) look at my code?
regards
Zory
I can look at your code. However, as I've said twice now in this post, I don't think the problem is in the code but rather in your directory structure and URLs. Neither of which have you provided yet.
Hi Larry,
Thank you very much for your reply. I need your further help on the same problem.
Per your advice, 1)I checked the directory structure in my computer, it's the same layout as Figure 7.5 at page 173 (htdocs/physical_product folder/images folder or products folder.)
2)i added RewriteBase /physical_product/ in .htaccess file, and index.php in firefox browser looks normal.
3) i've tried to change references(from /something to /physical_products/somethingas you suggested) shown below, but the browser reads: Object not found in coffee page:
- Coffee
What else can i try to overcome the structure problem?
If your directory structure is the same as that in the book, that's great, but your directory structure is not the same as in the book. In the book the files are in the Web root directory (htdocs), but you've placed everything within a subdirectory. This is fine, too, but you have to change all references accordingly. For example, the link to ./physical_product/shop/coffee is incorrect. The initial period means the link is relative to the current page, which won't often be the case. What you want instead is /physical_product/shop/coffee (as I wrote before), where the initial / means to start in the Web root directory.
-
Thanks for the nice words. As I wrote in my previous post to the original poster, I suspect the problem has to do with your directory structure (i.e., how the files are organized on your computer and what URLs you're using).
-
What format will $bid['createtime'] be in? Is that the same as the format that works when hardcoded into the script?
-
I did a Google search on "adobe air settimeout" and the first hit seems to address your situation: http://help.adobe.com/en_US/AIR/1.5/devappshtml/WS5b3ccc516d4fbf351e63e3d118666ade46-7f0e.html#WS5b3ccc516d4fbf351e63e3d118666ade46-7efb
-
First of all, thanks for the great book!
Thanks!
Second and more general question to this topic:Do you consider it a better way to switch a DB entirely to utf8 (if I need/want it in some columns), or to chose a collation like latin1_german1_ci in general and utf8 on specific columns?
I myself would say: use utf8 wherever possible because it is the future, isn't it??
It sounds like you're confusing the topics of character sets and collations. I would generally use UTF8 as my character set for all tables and columns. I would also set the proper collation for all tables and columns. You can then adjust the collation (but less likely the character) set on a column by column basis.
Simply writing this post helped me understand better ... (as so very often) So I'm giving some answers by myself:Kudos and thanks for adding your own solution.
Why do you (Larry) use a column "pass CHAR(40) NOT NULL" in the users table which is utf8 encoded (page 446 in chapter 15: Message Board)? Didn't you mention that using CHAR() wasn't a good idea in utf8 encoded columns?Yeah, that's a minor point. For performance reasons, the recommendation is not to use fixed text columns with UTF8. But for performance reasons, something like an encrypted password, that will always be a set length, should be a CHAR. And, of course, MySQL will change the column's definition to what it thinks it should be. So the answer is...maybe, maybe not!
-
First, thanks for posting all the key information. Much appreciated. The cause of the problem is the directory structure. You say that the images and products folders are in the root directory, but are they really? Or are they in the physical_products directory (per your URL)? If it's the latter, then you need to change references in the header from /something to /physical_products/something. You'll also need to set a RewriteBase in the .htaccess file, just after turning the RewriteEngine on:
RewriteBase /physical_products/
-
ANSWER1: NULL means "no known value". It's a very special kind of thing. It's possible you'll see it on a SELECT with no product_id in a LEFT JOIN.
ANSWER2: A Web reference on what?
-
I'm not exactly sure I understand the relationship among the tables, but... Yes, you can write an INSERT query for the values table as long as you know the product_id, value, and datetime. You don't need to do a SELECT query to grab those values unless you don't have them. Not sure how this is a JOIN issue, though.
-
Hey Jonathon,
Thanks for the words on the forum. As for Net_Geo, I'm a little confused. There's Net_Geo, which I used in the book, whose current version is 1.0.5. And there's Net_GeoIP, whose current version is 1.0.0RC3 (beta). Based upon the directory structure you originally indicated (Net/GeoIP.php), it looks like you installed Net_GeoIP, although I'm not sure where you get version 1.3 and that 2006 date from. Based upon the directory structure you indicate in this follow up post (Net/Geo.php), that's Net_Geo. So the first thing you'll need to do is pick one and go with it. If you want to match the book's instructions, use Net_Geo. If you want to use Net_GeoIP, see the PEAR documentation for that class.
-
Kudos for figuring it out and thanks for letting us know. In the future, please make sure you also include vital details such as the version of PHP in use, per the forum guidelines.
-
You should have been automatically redirected to the correct URL. But if you follow the Books By Topic > E-Commerce link at the top of the page, you'll be taken here: http://www.larryullman.com/books/effortless-e-commerce-with-php-and-mysql/#downloads
-
What version of PHP are you using? What version of PEAR Geo IP Location? How did you install the PEAR Geo IP Location package?
-
Hello Steve,
Thanks for your question. I looked at the article and I'll admit that there are a few points made in the article that I disagree with (e.g., the argument to use mysql_pconnect() or the failure to confirm that variables are set before referencing them). I also don't think the author convinced me of the merits of addcslashes() over mysql_real_escape_string(). The argument for mysql_real_escape_string() is twofold: first, it puts more functionality into the database, which is generally advised. Second, it performs the escaping in a way that's particular to the character set used by the database, so it's more particular and less generic than addcslashes(). Also, to be clear, the author isn't using addcslashes() AND mysql_real_escape_string() but rather addcslashes() INSTEAD OF mysql_real_escape_string().
To be clear, it's really a minor distinction between the two, but I prefer mysql_real_escape_string().
-
Thanks, Gregory, for the interest. I just suggested to the publisher that we do a new edition of this book, but I haven't heard back from them yet. Should they say yes, the next edition still wouldn't come out until 2012. Even though this edition came out in 2007, I think it's still reasonably up to date.
-
To edit a page, presumably you're passing the page ID in the URL, as you would with a delete page feature. Then, use that ID to retrieve the page's data from the database. Then echo out the page's content between the textarea tags used for the RTE.
-
This forum is specific to the fourth edition of the book "PHP for the Web: Visual QuickStart Guide", written by Larry Ullman and published by Peachpit Press published in March 2011 (ISBN 0-321-73345-2). If your question pertains to something specifically written in the book, including a particular script or bit of code, please make sure you're posting in the forum for the correct edition.
If your question is not related to any book, that's fine, too.
-
This forum is specific to the third edition of the book "PHP for the Web: Visual QuickStart Guide", written by Larry Ullman and published by Peachpit Press published in December 2008 (ISBN 0-321-44249-0). If your question pertains to something specifically written in the book, including a particular script or bit of code, please make sure you're posting in the forum for the correct edition.
If your question is not related to any book, that's fine, but I would recommend you post your question in the forum for the most current edition of this book, which will be the most active.
-
This forum is specific to the second edition of the book "PHP for the World Wide Web: Visual QuickStart Guide", written by Larry Ullman and published by Peachpit Press published in February 2004 (ISBN 0-321-24565-2). If your question pertains to something specifically written in the book, including a particular script or bit of code, please make sure you're posting in the forum for the correct edition.
If your question is not related to any book, that's fine, but I would recommend you post your question in the forum for the most current edition of this book, which will be the most active.
-
This forum is specific to the first edition of the book "PHP for the World Wide Web: Visual QuickStart Guide", written by Larry Ullman and published by Peachpit Press published in April 2001 (ISBN 0-201-72787-0). If your question pertains to something specifically written in the book, including a particular script or bit of code, please make sure you're posting in the forum for the correct edition.
If your question is not related to any book, that's fine, but I would recommend you post your question in the forum for the most current edition of this book, which will be the most active.
-
This forum is specific to the second edition of the book "PHP Advanced: Visual QuickPro Guide", written by Larry Ullman and published by Peachpit Press published in March 2007 (ISBN 0-321-37601-3). If your question pertains to something specifically written in the book, including a particular script or bit of code, please make sure you're posting in the forum for the correct edition.
If your question is not related to any book, that's fine, too.
Database Schema For Different Prices At Different Times Of The Year
in PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
Posted
Interesting question. Two options in my mind. One, just create four season columns in the database with the price for each season set. Then you'd use PHP to compare the chosen dates against the season dates (i.e., the definition of a season would be written into PHP). And the PHP code could decide how to handle a straddler.
Or you could create a table that stores date ranges and prices (so X records for X seasons per year). You'd then need to use some logic in PHP to get the dates for multiple seasons and apply the right rates.