Jump to content
Larry Ullman's Book Forums

rob

Members
  • Posts

    143
  • Joined

  • Last visited

  • Days Won

    16

Posts posted by rob

  1. Put the following code in any file that's in htdocs that you can run via the browser, copy the value you see on the page and paste it into the config file as your value for BASE_URI.

     

    echo 'Document root: ' . $_SERVER['DOCUMENT_ROOT'];
    

     

    If you're new to PHP this book could be difficult for you as it assumes PHP knowledge, you'd probably be better getting larry's latest edition of PHP and MySQL http://www.larryullm...de-4th-edition/ and work through that book first.

  2. Right, you're not done yet; all you've done is establish there's an issue with the value you're setting for BASE_URI.

     

    Echo the value of $_SERVER['DOCUMENT_ROOT'], insert this value into BASE_URI and change your script back to require(MYSQL).

     

    Does the script now work? If not, post the line of the BASE_URI with it's value from the config file.

  3. Sitepoint allow you to download a sample of the book, which will give you a good idea of the level and style, usually about 4 chapters. Also, I've always found that if you download the sample, between 24/48 hours later, they send you an email with a discount and link.

  4. The home page is looking so much better now you've removed the social network links and given post titles and intros a bit of white space.

     

    From a user point of view I'd personally like to see categories and perhaps tags under the search form input in the right sidebar.

     

    On Android, the Amazon flash widget is a real pain: takes up lots of space and doesn't work; I'd prefer not to see it at all on a mobile screen. I should be honest though and mention that I don't like the Amazon widget at all!

     

    I'm not keen on the 13px font size for post intros and main text, perhaps I'm just used to the adoption of 16px as the new norm on other blogs.

     

    Obviously, it's your design, you have to go with what you like and what works for what you're trying to achieve, but I thought some usability feedback would be useful.

     

    Edit:

     

    On the forum, would be really handy to have the recent topics at the top of the sidebar, instead of having to scroll down to find it.

  5. I know it is explained in the book but personally I don't understand what isset is all about.

     

    http://php.net/manual/en/function.isset.php Marie, you should really learn the basics of PHP before tackling this book.

     

    I am assuming that this would show up in the browser.

     

    No. The IPN is a listener script, it interacts with paypal directly, there is no interaction between a user (browser) and the script.

     

    You should read the tip on page 154 in the book for debugging.

     

    If the script is getting to the conditional in your script where the database query is being executed, you should construct the query and dump it to a log file so you can check it is what you're expecting.

  6. My one concern regarding automatically generating the thumbnails is that the page may take a long time to load. If there is an efficient way of doing this, I'm all ears.

    You generate the thumbnail image once at the point of uploading the original file. So, when a public facing page, like your gallery page, is requested by a user, the page simply makes the call to an image: the thumbnail has already been generated.

     

    I was able to finally solve uploading both images to the directory.

     

    Please share solutions, it's really helpful to all users and makes the thread more beneficial and a resource in the future.

     

    For your prepared statement remove the comma after the final ? parameter marker.

  7. hbphoto, you simply have to iterate over the $_FILES array and then do the normal processing within the loop.

     

    Generating the thumbnail server side is definitely easier for the user.

     

    We built an application for a professional photographer early this year and what we found was that photographers want complete control over how the thumbnail image looks. Judging from hbphoto's username I'm guessing he/she might be in the same position.

     

    For the application we delivered, one original image was uploaded, several predefined sized images were generated, then it took her to a page where she could create the thumbnail using a javascript draggable crop tool with live feedback on the page showing what the thumbnail would look like; which maybe also be an option for you hbphoto?

  8. For personal projects, I wanted to store my repos separately from our work, and github account.

     

    I was going to go with github, and was resigned to paying for the 5 private repositories plan (open repos are free and unlimited).

     

    However, while searching online I discovered that bitbucket.org now supports Git in addition to Mercurial and they offer unlimited private repos for free; the only catch being you are limited to 5 users on the account.

     

    This may be old news to some, but I hadn't really looked around for a while since settling on github. You can't beat free and I hope this is helpful to anyone currently considering.

  9. It really comes down to whether you the think the Unix system is any good, Edward. Asking whether a system is worth it based on image or trend means you're not looking at and comparing the right information based on your requirements.

     

    One thing I know for a fact, you've picked a topic that on the internet almost always turns into a flame-war and to which there is never a definitive answer. You can only ever pick what suits your requirements as an individual user; if those requirements are not really limiting you are free to pick the one you feel most comfortable with.

     

    From a development point of view, *nix based systems make a lot of sense, especially as most servers are running on a combination of linux and apache. But, this is perfectly possible on a windows system by running a server within a VM.

  10. ... Most books only explain of the box model, but actually there are 6 different box models, so if you find your CSS is not working correctly with this book you can pinpoint the reason...

     

    One of the reasons I try to avoid front-end development as much as possible, luckily I work with two very talented front-end devs.

     

    Good tip though, Edward.

  11. The Error message it's telling you exactly how to rectify the issue:

     

    You are *required* to use the date.timezone setting or the date_default_timezone_set() function

     

    http://php.net/manua...settimezone.php

     

    I don't have this particular book, but I would be astonished if Larry hadn't mention this setting before the part of the book that uses this script, perhaps you missed it?

  12. If I run the query in php my admin "substituting pass=SHA1('mypassword')" for pass='32charpass' " I get the row but I am stumped.

     

    Hash the password and echo this out before the SELECT query and manually check this against what is stored in the database.

     

    I can guarantee you this: If the query works directly from phpMyAdmin but not from your PHP script, then there is an issue with the DB connection.

     

    I would have said that since he's getting the script message "Either the email address and password entered do not match those on file or you have not yet activated your account." the db connection is fine but the problem could be the information stored is different to that being used in the SELECT query.

     

    I agree though, that checking the character encoding would be a sensible step.

     

     

    edit: i was posting this answer when you posted additional information.

    • Upvote 1
  13. Just so I can try and get the post right how should the script that I posted look. That would help me as then I will learn which parts of the script I need to display.

     

    Paul, check post #2 in this thread, how the code looks will be done automatically, you just have to remember to put the code tags around your code.

     

    [ code] [ /code]

     

    less space between opening square bracket and code /code.

×
×
  • Create New...