Jump to content

bsmither

Members
  • Posts

    213
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by bsmither

  1. Working on the irrational theory that, somehow, PHP is wanting to 'expand' the names of the constants in the quoted string, I would try this variation of the statement: $this->debug(3, 'Generated docRoot using SCRIPT_FILENAME and PHP_SELF as: '.$docRoot); using apostrophes to delineate the string, and concatenation.
  2. "public function get() in class DB, after processing, returns $this, the single instance of class DB, this is assigned to $data which is then used to invoke public function count()" I think not so much. In User->__construct(), the database class instantiation is given to $this->_db. The database method get() is called and the return from that method is assigned to $data. What is $data? In DB->get(), what is being returned? A complete recordset, probably, but what is the type of the return? An object? An array? It is not the database class instantiated object itself! If PHP is complaining that $data is not an object, and it has the recordset of the query response, then it must be an indexed array of associative arrays (the individual records of the recordset). So, perhaps: if(is_array($data) && count($data) > 0) What I like to do is: if( ($data = $this->_db->get('users', array($field, '=', $user)) !== false) making sure that DB->get() will return false when there is an empty recordset (or an error).
  3. I think... Even though everyone is agreeing to use utf-8, that does not mean the font in play has the glyphs you want to show. What application are you using to verify that the database has the correct characters? What application are you using where you see the replacement character (white question mark in black diamond)? Do both use the same font?
  4. A <table> will work, but I prefer to use style="float:right;". I recommend always coding the floated nodes as first in the group of nodes so that the floated node will be at the top of its container. <fieldset> <input name="words" type="text" id="words" size="60" /><br><br> <input type="button" id="rb" name="rightbutton" value="rightbutton" style="float:right;" /> <input type="button" id="lb" name="leftbutton" value="leftbutton" /> </fieldset>
  5. I would think javascript will still find it: var x = $('a#me').attr('name');or something like that. Will it cause problems later on? Anything is possible. But I would hope that anything discarded would stay discarded. Which means it's free for me to use.
  6. By using the command explode(), you will be given an array containing everything that is separated by the 'glue' character(s). Your statement would be: $arResult = explode('.', $string); The $arResult array will be: Array( [0] => '3' [1] => '12' [2] => '8' ) Be aware however, that a string such as: "3.12.8.234.5.12.89.49.34" will have nine elements in the array. If you wish to deal with only the first three (being separated by the first two periods), then $arResult[0], [1], and [2] will be your working variables. If you want to keep the third element undisturbed, that is, $arResult[2] just happens to end up being "8.234.5.12.89.49.34", then there will be some more processing by concatenating elements 2-8 back into a string.
  7. Please do not think that one can access an associative array by a positional index integer, nor an indexed array by anything other than a positional index integer. Try to use the column names. You should have some sort of idea what they are to line up with the HTML table's column headings. If you truly cannot know this, then you can convert the associative array into an indexed array: {foreach key=pid item=ri from=$row}{$ri = array_values($ri)}
  8. $row has the entire recordset, of which, you are iterating through it. The first iteration has record 0 of the recordset, and the value is an associated array - namely the names of the columns and the data in that column for that row. Does Smarty2 allow access to an associated (hash) array's elements by an index integer? Or must we use the hash key names (the column names of the table)?
  9. An "Undefined index" notice is just, according to one school of programming, an advisory that the programmer should declare/load the variables that are going to be used. Then, if you still get these 'undefined' notices, then you have a good idea that a variable that you intended to use is misspelled. For example: $arrParams = array('color' => 'Red', 'size' => "Large"); echo $arrParams['colour']; This will generate an undefined index notice because 'colour' is not the same as the intended 'color'.
  10. Using PHP 5.4.17 on Windows XP, and MySQL 5.6.17 on Windows Server 2003. In phpinfo(), I have: mysqlnd 5.0.10 - 20111026 I have a need to capture/analyze the MySQL TCP packets as they pass between client computer and database server. I'm using WireShark 1.12.1 to do it. I understand that compression of the payload will happen if both client and server can do it. (It seems that the MySQL dissector in WireShark does not yet automatically deflate the payload - according to a bugtracker entry.) So, is there a config file statement I can use, either in php.ini's [mysqlnd] section, or the server's my.cnf file, that will force zero compression?
  11. bsmither

    EXT2 FS Limits

    I appreciate your enthusiasm to get this sorted. But I already nuke-n-pave'd it.
  12. Thank you for your assistance with this. It has proved to be enlightening, To close this out, the expression I needed is to be used in a MySQL query. From the actual source code I was trying to modify, I knew the word boundary indicator is different. But there is more. I have also come to learn MySQL uses the POSIX language for it's RE engine, which means there is no lookahead. However, regardless of whether it is efficient or not, I will probably have to use: (`abc` RLIKE expr1) AND (`abc` RLIKE expr2) AND ...
  13. Interesting. Other than using your browser's javascript console, do you (or anyone here) have a console app that succeeds in showing a true result? Such as: http://forums.phpfreaks.com/topic/282231-at-last-regexbuddy-4-released/ Personally, I tried with The Regex Coach (v0.9.2, copyright 2008, Dr. Edmund Weitz) and Rad Software Regular Expression Designer (v1.4, copyright 2007, Ross Donald). May be I don't know how to use the Rad Software app.
  14. I found this regex, which is what I want, here: (?=.*\bdog\b)(?=.*\bpuppet\b)(?=.*\bfuzzy\b) It is suppose to 'succeed' if it can find all the given words in any order. Yet, when I try to test it against this sequence of words (or any other order of these words): need fuzzy hand puppet in dogpen for dog I get no indication of a match. What am I not understanding?
  15. I see four form elements (two input type=text, one textarea, one input type=submit), but no <form> tag enveloping them. So, unless you have some javascript (which I routinely disable) that is looking at the submit button, the browser does not know where to send the form data.
  16. bsmither

    EXT2 FS Limits

    Thank you, kicken. Not finding any other way (short of hard-mounting the drive in a Linux box - which I don't have and don't want to go to the trouble of getting one and learning it), I nuke-n-pave'd it. Very much appreciate your taking the time to respond.
  17. bsmither

    EXT2 FS Limits

    I'm going to say 'no', only because I don't know how to get Windows XP to send the proper command via ethernet -- if there is one. Also, the DNS won't have that info on the control panel. I did format the entire 1.5TB drive as one single volume (not that I had a choice). I don't have the funplug enhancement on this DNS unit, so I have no shell or telnet.
  18. bsmither

    EXT2 FS Limits

    I have a D-Link DNS-323 running some sort of Linux (probably) with the EXT2 filesystem -- connected to Windows XP SP3 via ethernet. Wikipedia says I can put a lot of files on the drive. But is there an actual limit? On the (root?) top-level folder, I have a sum total of 997 files and folders. I am trying to put a few more files onto the volume, but an error is being reported that says there is insufficient space. The DNS Status panel says I have about 700GB of free space. I am running the DNS's Scan Disk utility on on the volume now. I moved a few hundred individual files into a folder, thus reducing the number of 'objects' to 790 on the (root?) top folder. Still, the DNS reports I have insufficient space. I moved the file to another drive letter on the Windows system just to make sure the source wasn't corrupted somehow, and that transferred fine. Then I tried to move it onto the DNS and it still said insufficient space. I cannot give any info about how the EXT2 filesystem drive was formatted. Which is to say, if there is a configuration (such as block size) that would limit the total number of objects on the volume as a whole, I do not have that data. Is it actually possible to have 700GB free on a 1.5TB drive formatted EXT2, and have 'insufficient space'?
  19. name="quantity"[<?php echo $row['menu_id']?>]" size="5" I don't like the quote mark between the word quantity and the open bracket.
  20. I've been searching for a science that will solve this analysis problem. Since I don't know what I'm looking for, I cannot properly express the task to accomplish. I have an eCommerce store selling a product that has (let's keep it simple) three properties and each property can hold any one of three possible relevant values (or null). Combinations: 3^3=27 A typical combination would be round/solid/blue, or cubic/squishy/white. The task is to efficiently eliminate that part of the array if any particular {set of values} is null. That is, if I currently have no pink items, the relevant sections of the array would get eliminated. Product variations with low n-values is easy to manually handle. But with five and above, that's the math(?) theory I am trying to know the name of. (I wonder if any Matlab manuals would give a clue.) I am trying this elimination of sections of an established array instead of rebuilding the array every time a value is locked in. On the other hand, maybe I'm trying to be too smart about this and should just let the server do the grunt work over and over.
  21. I will assume the code above is an accurate representation of what you actually have. So, $_SESSION['cart']['$key']['quantity']=$value; The $key is delimited by apostrophes (single quotes). Thus, PHP will not treat this as a variable name. In the HTML <form> block, your <input name="quantity"> is not structured as an array. If these inputs are meant to be an array, then the tag should be <input name="quantity[3]"> where 3 is the key index into the cart's array of inventory - probably the product_id value.
  22. If all this turns out sorted, maybe move the thread to whatever other forum is appropriate.
  23. Would any of these settings influence a GET value of 800+ characters for a given key? suhosin.get.max_name_length 64 suhosin.get.max_totalname_length 256 suhosin.get.max_value_length 512 suhosin.get.max_vars 100 suhosin.post.max_name_length 64 suhosin.post.max_totalname_length 256 suhosin.post.max_value_length 1000000 suhosin.post.max_vars 1000 suhosin.request.disallow_nul 1 suhosin.request.disallow_ws 0 suhosin.request.max_array_depth 50 suhosin.request.max_array_index_length 64 suhosin.request.max_totalname_length 256 suhosin.request.max_value_length 1000000 suhosin.request.max_varname_length 64 suhosin.request.max_vars 1000 suhosin.server.encode On suhosin.server.strip On
  24. I fed the querystring to my local system and it's all good. I modified the index.php file on the other system to show: 21:39:35UTC - 10/12/14 URI => '/index.php?_g=rm&type=gateway&cmd=process&module=SagePay&cart_order_id=141012-123456-0000&crypt=@5057f-800chars IP:PORT=>PORT => '94.x.y.z:80' COOKIE => 'abc' POST => '<empty>' GET => Array ( [_g] => rm [type] => gateway [cmd] => process [module] => SagePay [cart_order_id] => 141012-123456-0000 ) REQUEST => Array ( [_g] => rm [type] => gateway [cmd] => process [module] => SagePay [cart_order_id] => 141012-123456-0000 [__utma] => 123 [__utmc] => 456 [__utmz] => 789 [username] => abc@**.com [PHPSESSID] => abc ) I will agree 99% it's not a PHP setting. That still leaves a security add-on to PHP that may be the culprit. Any suspects come to mind? Would it even be possible? Would you think that parse_str() would not be affected by any such security addon, if that were the case?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.