Jump to content
Larry Ullman's Book Forums

mica123

Members
  • Posts

    13
  • Joined

  • Last visited

Posts posted by mica123

  1. 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.
     

  2. 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

  3. 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.
     

  4. 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...