Jump to content
Larry Ullman's Book Forums

Larry

Administrators
  • Posts

    5413
  • Joined

  • Last visited

  • Days Won

    155

Posts posted by Larry

  1. I took the what should be the output of your code and tested it in two browsers and it worked for me in both (both popup windows worked). Here's the code I was testing, which should be what your PHP script it outputting:

     

     

    <a href="form_selection.php" onclick="window.open(this.href, 'popupwindow2','width=600,height=400,left=30, top=10, scrollbars=yes,resizable=yes');return false;"> Select and Prepare New Legal Form </a>
    
    <a href="view_full_record_form.php?rec_id=X" onclick="window.open(this.href, 'popupwindow','width=1000,height=800,left=200, top=50, scrollbars=yes,resizable=yes');return false;">Some Title</a>

     

  2. Okay. If you're having problems with images and CSS not showing up, then you need to change your references to those resources so they are absolute and correct. If you're having problems with other pages not working, debugging really depends upon what, exact, problem you're having. "Does not work at all" isn't informative.

     

    Also, I appreciate that you're trying to provide information by linking to pages on your site, but that does require people to take extra steps in order to assist. How about putting your information here, and then also linking to the relevant pages?

  3. Mike (*3), kudos for figuring it out and thanks for sharing the solution. I do believe that PEAR is failing to live up to its promise, and the Zend Framework may be a better alternative. It's easier to install, is kept updated, and can be used in pieces. I'll have to think about this when I go to do the third edition next year.

  4. htaccess files need to be off of the web root or web accessible folder.

     

     

    To be clear, .htacess files MUST be within the Web directory.

     

    If the original poster is still having problems with this, please check out some of the other threads on the topic and see if that helps. If not, return here. And please post the actual details of your server.

     

     

  5. I primarily used the command line mysql client to test the procedures, although I think I created and edited them using phpMyAdmin. Some people experience problems with stored procedures in phpMyAdmin and others don't. It's not clear what the main difference is. Here's what I had written in a thread in the old forum (http://www.larryullm...ad.php?24,50607):

     

    I don't know what version of phpMyAdmin I used previously as I just upgraded. I'm now using phpMyAdmin 3.2.5 with PHP 5.3.2 and MySQL 5.1.44. It's using the mysql PHP extension. This time I could call the stored procedures using either the SQL tab or the SQL popup, so long as I named the database--CALL ecommerce2.select_sale_items(1)--and so long as I DID NOT select the database in phpMyAdmin first. In other words, I had to be on the phpMyAdmin home page to start. Clearly, phpMyAdmin is inconsistent about how it deals with stored procedures.

  6. On Saturday, April 30th, 2011, sometime late in the evening or overnight (EDT), this site will be temporarily unavailable on account of server maintenance. The outage is not expected to exceed 15 minutes. Apologies in advanced for any inconvenience.

  7. I think what happened is you intended to type exit(); instead of quit(); There a few places I found this "typo" but one is:

     

    Chapter 4 page 80.

    At the end of redirect line just in case the redirect doesn't work php won't keep on processing the file and display content on the page that shouldn't be shown. I do this too.

     

    What version of the book are you using? I'm looking at Chapter 4, page 80, of the very first printing of the physical book, US, English language, and there's no use of quit() at all.

     

    You use exit() a lot in the book, I looked it up at php.net and it says this is used to display a message before stopping process of the file. Though in most the cases I see you using this there is no message so in these cases wouldn't it be better to use quit; ? Besides the message thing, what benefits are there to using exit() vs quit or is it just personal preference?

     

    Again, as far as I know, and if I'm wrong, please provide some documentation, but there is no "quit" in PHP. As for exit(), I almost never use it with a provided message.

     

    I also found a typo on page 87 in section 9 you have create_password_hash($p) where it should be get_password_hash($p).

     

     

    Yeah, I believe that's already on the errata page. That's what I get for changing the name of a function during the rewrites!

     

    Oh. I did not know that and have never used it before. Instead what I do is something like:

     

    include('/subfolder1/subfolder2/');
    

     

    This goes down two folders by name from the current file that is being called from. I didn't know I should add a period there at the beginning because it works, I maybe doing it wrong and never knew it.

     

    No, that does not go down two folders. It may have that effect, but that's not what the code is doing. What you have is an absolute reference, which is anything that starts with / or C:\ or http:// or the like. The initial X says "start with the root and go from there". Conversely, any reference that begins with a period, or two periods, or a file name or a folder name--in other words, any reference that doesn't begin with an absolute starting point, is a relative reference, relative to the current script.

     

    This can be confusing stuff, I know.

     

     

    Oh, and big thanks for helping out in answering some of the other people's questions. I really, really appreciate it!

     

     

  8. Hello Mike (*3). I was able to get the following working using the MySQL Workbench on my Mac (10.6.6) with MAMP and MySQL 5.1:

     

     

    CREATE FUNCTION return_distance(lat_a DOUBLE, long_a DOUBLE, lat_b DOUBLE, long_b DOUBLE) RETURNS DOUBLE 
    BEGIN 
    DECLARE distance DOUBLE; 
    SET distance = SIN(RADIANS(lat_a)) * SIN(RADIANS(lat_) 
    + COS(RADIANS(lat_a)) 
    * COS(RADIANS(lat_) 
    * COS(RADIANS(long_a - long_); 
    RETURN((DEGREES(ACOS(distance))) * 69.09); 
    END $$

     

×
×
  • Create New...