Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: My First All PHP Script

  1. #11
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    cool.

    Quote Originally Posted by keyboard1333
    Have you thought about storing the history in a cookie instead of a session (so it shows up if they close->re-open the browser).
    I'm a little surprised you (John) didn't do it that way. I'd use localStorage (there are several JS polyfills for browsers that don't support web storage yet). But I understand, we're focusing on the PHP side.

    code is good. biggest thing I'd change is how you're storing the quotes -
    Code:
    array( quote,citation,quote,citation )
    is pretty fragile. For a flat file, I'd use JSON, and put each quote/citation pair in their own array.
    Code:
    [
       [ quote,citation ]
      ,[ quote,citation ]
    ]
    if you'd like to hear more, let me know. I'll read it all the way through tomorrow.

  2. #12
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'd thought of that too. And it is a better way to do it. But the way they're stored now is so much easier to maintain, especially for a non-coder. It would be fairly easy to change things around to accommodate various formats for the quotation file/data.

    Sure, I did this to learn as much as anything else. And that's one of the reasons why I posted, to get comments.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •