Jump to content
Larry Ullman's Book Forums

Jonathon

Members
  • Posts

    1064
  • Joined

  • Last visited

  • Days Won

    55

Everything posted by Jonathon

  1. Chrome is my browser of choice now. Firefox still for CSS and JS dev though
  2. I had an issue lke this and it was due to my config. I had to comment out some session and url parameters I'd made.
  3. in your config put date_default_timezone_set('supported time zone goes here'); http://www.php.net/manual/en/timezones.php
  4. Thanks Paul, I currently have the videos outside the document root, but i'll drop in a .htaccess file anyway. I'd no idea it would have been this easy to just download videos online. I'm surprised that HTML5 doesn't allow some form of DMR protection really. But it's not much harder in HTML4 really.
  5. Rob, Thanks for the effort with this, I shall see about how to integrate this concept into WordPress. It's a problem that the movie industry have failed to solve ever since the web was born. I must admit I am not a fan of WordPress really, for 1 real reason, I'm sick of seeing "Web Developers" who wouldn't know what PHP was if it hit them in their face, yet make fortunes by pointing and clicking. But I must agree the platform itself is a good thing. But I'm fighting a losing battle with negativity, it doesn't hurt to be versed in the number 1 CMS. Thanks Again
  6. Yeah it does seem a little tricky protect. HTML5 seems almost impossible to protect. To add to my problem, I'm doing it in WordPress, it's my first WP adventure really. I've got them in a folder outside my rootusing this plugin that is meant to secure html5 video, but it doesn't, you can just right click save the video. I don't have to use HTML5, I just gave it a bash as at least I could keep the videos looally, I didn't imagine it would be that hard to protect my DMR. Thanks for your points Rob
  7. Hi Larry, I seem to be fighting a losing battle, I have a sports club website, which is going to have instructional coaching videos on. These videos are only for members of the club, so they are behind password protected pages. I need to keep these videos secure so that members can just view them, if I use HTML5 it seems as simple as saving an image that you can just save a HTML5 video. If I use something like unlisted videos in Youtube, it isn't that hard to just watch on youtube and get the link to the video and always have it, therefore they could just distribute the link to other people outside the club or worse, it seems that there are apps knocking about that will download and save youtube videos. I know that these are members of our club, unfortunately, there is a degree of movement between members of our club and other clubs, plus often families will have kids in different clubs. We know that we have a very good series of coaching videos so it's important that we protect all the videos. What if anything could be done to secure the safety of my videos? Hope you're well, Jonathon
  8. Yes I would. Although I think it still works technically, at some point it won't, as i understand it.
  9. You need to store the result for outbound queries, you do not need this step for inbound ones, you would more likely just use if(mysqli_stmt_affected_rows($stmt) ==1){} to confirm that 1 row was affected.
  10. prepared statements make the database handling escaping of data, I don't think it ever combines the whole SQL query, it keeps the variables separate (i think). So you shouldn't use mysqli_real_escape_string with prepared statements or as Larry put it tome a while back "For one, you don't need to do that when using prepared statements (which is to say, you shouldn't do that when using prepared statements)."
  11. For me: I'd use a Regex for a first and second name and passwords VALIDATE_EMAIL for emails telephone numbers specify a format already ie. "numbers only" or perhaps again a regex that allows for spaces and or hyphens. VALIDATE_INT or typecast when checking $_GET['id'] Regex's are expensive so where there is a decent alternative I'd use that. I'd also use them with prepared statements leaving the escaping to the database.
  12. I would disagree, a book on OOP can't teach Yii as well, it would be massive, just as a book on Yii can't teach OOP for the same reason and that you wouldn't be able to even get into Yii until you'd read a significant number of pages on OOP.
  13. Yes apply standard php / mysql debugging techbiques to retrieve the full error.
  14. Yes, OOP isn't syntactically difficult in my opinion, but it is difficult in how to organise and plan for the classes. It requires a lot of logic and forward thinking about how the classes should be used extended or abstracted etc. It's something a book can't really teach, it's something you need to discover through guidance.
  15. I would disagree Danny, if these are your first steps in PHP and MySQL a framework is not for you. To use a framework you need to a) be comfortable with PHP and coding, you also need to be comfortable with SQL and finally you need to be able to code PHP in objects. All of these skills take time, practice and exposure. :-)
  16. I was going to suggest that, but I started to think that it would just produce separate indexes as opposed to a tandem one, so just thought ASK. I did flick through the book, I didn't notice it in the SQL section, but to be honest that means absolutely nothing! But thanks Larry
  17. Hi Larry, Thanks for getting back to me, looking at my exported table my SQL is: CREATE TABLE IF NOT EXISTS `carts` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `quantity` tinyint(3) unsigned NOT NULL, `user_id` int(4) unsigned NOT NULL, `category` tinyint(3) unsigned NOT NULL, `product_id` varchar(15) NOT NULL, `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `date_modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), UNIQUE KEY `product_id` (`product_id`), KEY `user_id` (`user_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=86 ; Looking at my SQL it is due to my index stopping the same item being in there twice, to overcome this how do I go about it? I'm sorry if this sounds stupid, I'm not sure how to get the UNIQUE index to work in tandem?
  18. Hi Larry, I've adapted slightly the procedure from the book, but I find that if I have 2 users each with their own cart and user 1's cart tries to put an item that is already in user 2's cart I get an error, in that the cart doesnt update, so I plugged the query inside PHPMyAdmin and I get this actual error: #1062 - Duplicate entry '125234' for key 'product_id' PROCEDURE `add_to_cart`(uid INT(3), cat INT(1), pid VARCHAR(15), qty INT(3)) BEGIN DECLARE cid INT; SELECT id INTO cid FROM carts WHERE user_id=uid AND category=cat AND product_id=CONVERT(pid USING utf8) COLLATE utf8_general_ci; IF cid > 0 THEN UPDATE carts SET quantity=quantity+qty, date_modified=NOW() WHERE id=cid; ELSE INSERT INTO carts (user_id, category, product_id, quantity) VALUES (uid, cat, pid, qty); END IF; END I'm a little confused as to why right now - do you have any ideas at all
  19. Its not your email that sends the email. You need to find out what the smtp address is for your internet service provider (isp). That link I gave you even shows you what a smtp is and how it is different to an email address.
  20. This isn't how you set up a server. It needs to run through a legitimate ISP, you are just setting a FROM header. http://roshanbh.com.np/2007/12/sending-e-mail-from-localhost-in-php-in-windows-environment.html
  21. Single quotes will print literally $name. You need to concatenate with single quotes in order to actually print the $variables value.
×
×
  • Create New...