Jump to content
Larry Ullman's Book Forums

Jon

Members
  • Posts

    9
  • Joined

  • Last visited

Jon's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I'm not sure that using if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) is such a good idea as it allows for example, fred@theshed without any domain qualifiers following, but the preg_match used in PHP 6 and MySQL 5 seems to work well. Or maybe I am missing something ?
  2. I would really appreciate some feedback about this from Larry or anyone else who has used Servint. I have decided to take Larry's advice and get VPS hosting simply to avoid future headaches with server issues but I am wondering just how easy (or not) it is to setup a VPS account so that it is secure and performs well. In the book, Larry mentions a firewall being one of the minimal requirements which seems sensible. I have been in touch with Servint who say that their VPS does not come with a firewall installed as many of their customers do not want or need a firewall, though they would install one for me which I would have to configure myself. This puzzles me - why would anyone not want a firewall? Basically, what I would like to know is what I am letting myself in for with VPS in terms of configuring a firewall and installing/uninstalling software and whatever else is needed to get a PHP/MySQL site up and running securely. Though I have picked up bits here and there about server configuration, I'm not an expert on it so I'm a bit apprehensive about spending an excessive amount of time on figuring out VPS permutations when I still have a lot of work to do on the website itself!
  3. Thanks Larry. Thinking about that, it would also avoid the overhead of posting the data back to the client every time the selection changed in a select combo, which could be anything up to 100KB or so every time. I assume I would just store a reference to the object in a session? I have written my own session handler to prevent multiple logins using the same account and plan to use a session timeout by modifying php.ini, so would I be correct in thinking the server would take of deleting the object when the session is over. regards Jon
  4. My SQL is full of inner joins already. That is part of the problem as it was becoming hard to see what was going on! Using a couple of class objects as if they are C type structs has helped to reduce the clutter by encapsulating some of the queries but it would be nice to be able to reduce it even further by avoiding the need to keep instantiating new objects every time a form is submitted by POST, which is quite often. For instance on one form I have four select tags three of which trigger updates of the other selects, so using objects helps to make clear the already quite complex code that handles it. I have tried passing an object by reference in a hidden variable in the form but this does not work. Having had a look around the web, I suspect that what I need to do is use a php serialize function to turn the object into a string, so that it can be then submitted with POST and then handled in the script by unserializing it. I think this would be a useful technique for anyone to know as it would make very complex forms a lot easier to develop. Does this book mention anything about serializing or does anyone know anything about using it?
  5. I am developing some forms for a content management system and as some of them are becoming very bloated with SQL queries and other code connected with multiple select tags etc I have decided to convert my code to objects. The problem is that I cannot seem to find a way to make the objects persistent when I submit the form. I am quite familiar with C++ so understand OOP but am new to using it with PHP and though I have a couple of Larry's books I do not have this one yet, so would appreciate any tips. Does the book help at all with this issue? Jon
  6. With a bit of trial and error I have found the answer which I have put below for anyone else who may have this question. The answer is to use the -C cookie option. This example submits 200 requests. I searched for the word "moore" using the exact phrase field (ep is exact phrase) and the other two parameters ew and ex were not used. For testing on your own server the normal URL following the http:// might be: localhost/search.php?ep=moore&ew=&ex=&submit=Start+Search!&submitted=TRUE The Apachebench command is: ab -n 200 -C "ep=moore; ew=; ex=; submit=Start+Search!; submitted=TRUE;" http://localhost/search.php
  7. I would like to test my database search page which has 3 options that I pass using GET i.e. exact phrase, each word and exclude words. Can anyone tell me how I can do this with Apachebench. Entering the url doesn't work.
  8. Using email arrival time wasn't a good illustration, but all the same the routing issue is something I would like to consider as the quality UK hosting that I have found so far seems to be quite a bit more expensive than that in the US. I suspect that routing time over the pond may pale into insignificance as I will be providing full text searches on a very large database of text and individual pages of content will be anything from about 1K to 100K so having found out about Apache bench in the book, I would like to factor in all the other variables - a further excuse to delay launch - Another excellent book by the way Larry. regards Jon
  9. Having just got Effortless E-Commerce I am thinking about using VPS hosting in the US, but since most of my website members are likely to be in the UK at least to begin with, I am wondering whether this is a good move. When I registered on this forum, it took nearly 10 minutes to get the activation email whereas when I send and receive emails between my UK addresses it is virtually instant. Can someone tell me what kind of time lag I could expect for UK users accessing a website in the US compared to a similar quality hoster in the UK.
×
×
  • Create New...