Jump to content
Larry Ullman's Book Forums

fingers

Members
  • Posts

    11
  • Joined

  • Last visited

Everything 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. I'm having trouble getting php documentor to work and keep getting the message: cannot open phpDocumentor.ini in directory C:/xampp/php/pear -Is phpdoc in either the path or include_path in your php.ini file? Is there any way that I can fix this without spending 2 days trying to figure out what I'm being asked? Thanks, Gary
  5. The column is defined as int but it's ok it seems to have fixed itself and it now works. Whenever I post in here this always happens! Outstanding service!
  6. 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
  7. In the connection scripts, the set charset functions use 'utf8' e.g. mysqli_set_charset($dbc, 'utf8'); (Script 9.2 - mysqli_connect.php) $mysqli->set_charset('utf8'); (Script 16.1 - mysqli_oop_connect.php) Is there a difference between 'utf8' and 'utf-8' ? Thanks Gary
  8. I've just tried it again and it worked this time. Strange things these computers. Thanks Larry
  9. Hi Larry Here's what phpinfo() returns. fileinfo support enabled version 1.0.5 It's PHP version 5.4.16 Am I looking at the right thing? Thanks Gary
  10. I have had the same problem. The error messsage is: Fatal error: Call to undefined function finfo_open() in C:\xampp\htdocs\larry\13\upload_rtf.php on line 18 I have activated the fileinfo extension.... extension=php_fileinfo.dll ....but without success. Any help appreciated. Gary
×
×
  • Create New...