Jump to content
Larry Ullman's Book Forums

fingers

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by fingers

  1. I thought I'd take 5 minutes to share this thinking that if it saves 1 person the 6 hours that it took me to find this solution then it's been worth my 5 minutes!

     

    I use windows 7 / xampp / php 5.5.11 and my computer and pear are not friends. Pear rarely installs anything correctly. When I ran 'pear install HTML_QuickForm2' from the cmd tool it just gave me a QuickForm2 folder which contained a bunch of other empty folders. Here's how I fixed it

     

    1. I deleted this folder and downloaded the HTML_QuickForm2-2.0.2.tgz from the pear website.

     

    2. I extracted this using 7zip. This gave the following folders: data, docs, HTML, tests. (It also gave me a package.xml file which I completely ignored).

     

    3. I put the contents from HTML in c:/xampp/php/pear/HTML

     

    4. I put the contents of tests in c:/xampp/php/pear/tests

     

    5. In the data folder there is a quickform.css file - I placed this in c:/xampp/php/pear/HTML/CSS

     

    6. In the data folder there is also a js folder - I placed this in c:/xampp/php/pear/HTML/Javascript

     

    It might not be perfect but it has worked for the chapter 9 example.

     

     

    As a side note I also discovered that, for the add_page.php script, you don't actually need to use addElement() and then specify the type. There are addTextarea() and addSubmit() area methods.

     

    Hope this helps someone!

     

     

    Cheers for the great work Larry!

     

    Gary

  2. Hi Larry

     

    Whilst debugging an error in script 9.9 - page.php I inadvertantly discovered that array('min_range' =>1) doesn't seem to do anything in this line:

     

    !filter_var($_GET['id'], FILTER_VALIDATE_INT, array('min_range' => 1)))

     

    After fixing my problem I played around with this, changing it to == 2, < 0, => 5 etc. and omitting it altogether, yet the script still worked.

     

    Have I missed something?

     

    Thanks

    Gary

  3. I can't find phpDocumentor.ini anywhere. I've searched xampp/php/pear which is where I think it should be. Where is it usually placed?

     

    I'm using:

    Windows NT HOME 6.1 build 7601 (Windows 7 Home Premium Edition Service Pack 1) i586

    Apache/2.4.9 (Win32) OpenSSL/1.0.1g PHP/5.5.11

     

    I'm guessing that it's not there for some reason. I've seen some online but they all have differences.

     

    Thanks

    Gary

  4. Yo Larry

     

    For some reason my script only works when I quote the integer i.e '%d'

     

    $q = sprintf("INSERT INTO tasks (parent_id, task) VALUES ('%d', '%s')", $parent_id,
    mysqli_real_escape_string($dbc, strip_tags($_POST['task'])));

     

    If I don't do this the task does not get added. Any ideas?

     

    PHPStorm hinted that I should do this.

     

    I'm using - Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.15

     

     

    Thanks for the great work

    Gary

×
×
  • Create New...