Jump to content
Larry Ullman's Book Forums

Edward

Members
  • Posts

    1115
  • Joined

  • Last visited

  • Days Won

    27

Everything posted by Edward

  1. Hello, i am not Larry, but i will answer a little. If you are using PDO it would depend on what type of application you wanted to build, most of the online software available online is using MySql as its base. Mysqli also has its own class which you can extend and override its functions if you wish. If you are new to PHP you should begin with MySQL because being able to use PDO to select any type of database driver like Oracle or MySQL etc is implementing an Object-Orientated design pattern called the "Factory Pattern" When you begin learning PHP you will code in the procedural style where as Object-Orientated is Advanced PHP. That's why Larry's books are starting of with MySQL and because its the most widely used database software it being free.
  2. I find when doing this kind of coding that most of your answers will be answered as soon as you start practicing using the code. I am plowing through this book right now, not far to go, then after it is completed i will work on all the js common problems into my practice site. I think some of the worst stuff in the book which was this sibling, nodes, brothers and sisters stuff etc, that can be confusing, but then again if it was my own code it probably wouldn't be.
  3. The traditional approach to event handling starts on PG.269. You will see the 'on' word in front on the traditional event handlers onload etc. e.g window.onload = function() { } You can only assign single event handlers using this method and events can therefore be easily overwritten. So this method you have here from the book below is the newer method which works to cover multiple browsers. addEvent: function(obj, type, fn) { 'use strict'; if (obj && obj.addEventListener) { obj.addEventListener(type, fn, false); } else { obj.attachEvent('on' + type, fn); } } For this new method you have to use e.preventDefault to stop event handlers being reset with the form so they are no longer present. Its also am not quite clear to me what this means what is the gap between both? And what does reset of the form mean exactly? Please take note of the errata for page 298: The fourth paragraph should begin “For browsers that do support…”.
  4. Thanks i am a beginner to js. Can you show me some further reference to the addeventlistener part as i never saw this before.
  5. Is this line correct Hartley? ajax.addEventListener('readystatechange', handleResponse, false); of my knowledge so far with the ajax object i know i can do it like this ajax.onreadystatechange = handleStateChange; (Ref PG.429) Also in the js book library file // Script 11.1 - ajax.js // This script defines a function that creates an XMLHttpRequest object. // This function returns an XMLHttpRequest object. // Script 11.1 - ajax.js // This script defines a function that creates an XMLHttpRequest object. // This function returns an XMLHttpRequest object. function getXMLHttpRequestObject() { var ajax = null; // Most browsers: if (window.XMLHttpRequest) { ajax = new XMLHttpRequest(); } else if (window.ActiveXObject) { // Older IE. ajax = new ActiveXObject('MSXML2.XMLHTTP.3.0'); } // Return the object: return ajax; } // End of getXMLHttpRequestObject() function. So the ajax = new XMLHttpRequest() would be okay for newer versions of IE.
  6. This is an interesting piece of code, have to make one of these later on but with no extension limit. I am almost at the end of the js book now, this topic was briefly mentioned in it.
  7. What does this mean exactly "Indeed I want to retrieve 3 post titles related to the one is viewed at the end of the post." If you are retrieving related posts you will need to check to see if the current post has a parent_id which is equal to the post_id. You will need an extra column in your posts table parent_id to do this, you will also need the post_id column which is a primary key and set to auto increment.
  8. I was thinking along those lines also. I checked the W3schools site and it was identical as to your earlier confirmation. Well its been interesting this thread never the less.
  9. There are many articles online i found this one which may help: http://net.tutsplus.com/tutorials/php/how-to-send-text-messages-with-php/
  10. Yes that's all well but there is still an extra call for include_once ('../includes/config.inc.php') on line 75 according to your error handler, even if you are using include_once you only need to make a call to include or require the config.inc.php one time. Therefore you need to check line 75 of your script to remove that extra line out.
  11. Its a nice diagram you have there, i checked to see if i can could find a contact for that guy on http://www.comptechdoc.org/independent/web/cgi/javamanual/ but there is no contact email. May be we can find one through his whois, we need to write into him and ask him to update his misleading website. The trouble is if we were to keep pinching every small point we would never get anything done, somethings we need to let them be.
  12. I actually found the website where i originally got this info from http://www.comptechdoc.org/independent/web/cgi/javamanual/javanavigator.html If the navigator is a representation of the client internet browser then technically it is higher level than the window object, even though the window object contains the navigator object. How can i window display a browser, the window is displayed in the browser, i guess this is what this guy was implying. Whatever though i don't really care, document and window are enough for me to get my work done and make $$$.
  13. Hopefully someone will give us some more insight into this. Correctness is something that lacks in my country, that is why my attitude is like this i see things differently.
  14. Thats exactly as i done for mine and it worked like a chime, good luck with your work.
  15. Well whether is or not it does really matter as common properties can be accessed via document or window and thats all we need.
  16. Just put an SQL update on your script page at the top which adds 1 to the views each time the script is viewed.
  17. Yeah thats what i was meaning. But hey i read oine that navigator was the highest level of object and window was below followed by document.
  18. Yes it was the kind of error that can be easily overlooked even though we are aware of common debugging techniques. Larry this is a small meesage to you please check the download code for htaccess file chap2. Despite of what happened i am happy with the way this has turned out, mod rewrite has been something i wanted to do for a long time its awesome. Its funny did you ever see ebay or amazon tidy up their urls.
  19. Window is a property of navigator and so document is a property of window. That's what you are saying? But all these properties are methods in objects?
  20. Okay i got it working it was because the download file was htaccess the initial period was missing and it was of file type FILE. Well this means I will get some peaceful sleep and will have no more nightmares of a .htaccess file coming after me.
  21. There is test you can do with .htaccess to see if the file is being run, you can type in the .htaccess file just the word "test". If you run that directory and you don't get an error than means its not begin run, which i didn't.
  22. Okay i moved the scripts into the root now htdocs folder. So the AllowOverride All was now automatically set by default in the script. I have put the original version of my script back up. Yes i am using the newest download of XAMPP 1.8.1. I see you are +2hrs GMT of me, i may come over there and visit you one of these days, never been to Japan before. But this New Years i am going to Hong Kong, so i will come next year sometime.
  23. Require the config.inc.php file at the top of the script. require ('./includes/config.inc.php'); There is also a require_once php function you can use, so if you do have require somewhere else then it won't load that php script again.
×
×
  • Create New...