Jump to content
Larry Ullman's Book Forums

mica123

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by mica123

  1. Thanks, Larry. Well, I got a little confused here because I was under the impression that if variables are defined, they don't actually run. However, I can see now that the second variable is a function which is supposed to be executed once the script is put to work. Thanks for your patience.
  2. I have finished the book which is very informative and I have the following questions: 1) You say in Chapter 10 that user-defined functions add extra memory requirements to the PHP code and that they should not be used if they call another PHP function or if they have just one line of code. Even so, I am not sure how one should go about it. It is difficult to see when they can be used or not. 2) In the last Chapter 13, you have code that refers to running a query. For example: // Define the query: $query = "DELETE FROM quotes WHERE quote_id={$_POST['id']} LIMIT 1"; $retrieve = mysql_query($query, $dbc); // Execute the query. This code executes the query but I am confused. It seems to me that the code sets the variables - on the face of it is not actually running anything, yet it does. That's what I don't understand. Many thanks.
  3. Thanks, Larry. Thank you too for writing this book - I very much appreciate the clear explanations and examples. Sometimes I get confused - for example in this very Chapter it took me some time to work out that making a new directory in fact means making a new subdirectory in a directory I was supposed to create beforehand. Thanks for your patience.
  4. I would be grateful if you could explain what this code (substr($item,0, 1) means in this particular case. Thank you.
  5. Sorry, please disregard this question - after countless checks and rewrites it now works - but I am not sure why. It may have been due to a typing error. Thanks.
  6. I am sorry, Larry, I have to ask yet another question. I ran the 11.4 script - it works, there are no error messages, only the successful one "Your file has been uploaded." But there is no file in the destination folder. I use your line of code: if (move_uploaded_file ($_FILES['the_file']['tmp_name'], "C:\Main\uploads{$_FILES['the_file']['name']}")) { I have xampp and I created a folder outside xampp as you can see - I have all the permissions. I tried everything and still no file. Regards
  7. Hello Larry, sorry to have to ask another question. I do understand that in html one has to put a backslash to escape characters. However I do not understand the use of \t\tfont-size and \t\tfont-color Is this supposed to be for two tabs? I tried with and without the \t\tfont-etc. and I don't see any difference. Many thanks
  8. sorry, I meant: no need to use the function isset here except for the terms checkbox. Thank you.
  9. Hello, This chapter contains this tip: "One thing most beginner developers don’t realize is that it’s possible—in fact, quite easy—for a hacker to submit data to your PHP script without using your intended HTML form. For this reason, it’s important that you validate the existence of expected variables (i.e., that they are set), their type, and their values." I take it that the example presented in Script 6.7 demonstrated how to validate the fields? So that there would be no need to use the function isset in this particular case for example? Than you.
  10. Many thanks for your help! This topic can now be closed - I am not sure how to close it myself.
  11. Many thanks for your reply! I had a look at some of your scripts and I can see this <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> Are there any other tags I should be aware of? Thank you.
  12. In going through this particular edition the HTML pages are supposed to be created with <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Do I have to input these particular HTML tags - or can they be safely replaced just with <!DOCTYPE HTML><meta http-equiv="content-type" content="text/html; charset=utf-8" />? Thank you.
×
×
  • Create New...