Jump to content

bsmither

Members
  • Posts

    213
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by bsmither

  1. "will it be hard to process" Technically, no. It will be onerous to setup and probably tedious to maintain. But well within the computational power (memory and execution time limits) of PHP.
  2. To actually give you something that exactly answers your desire: function splatter($array) { foreach($array as $key => $val) $GLOBALS['splattered_array'.$key] = $val; } You now have a variable named $GLOBALS['splattered_array17'] or $splattered_array17, for example.
  3. I would start with a 100 element array, the first 25 elements describes Scene1, the second 25 describes scene2, etc. Then I would shuffle() the array. For each index, the scene shown will be a (somewhat) random choice from scene 1,2,3, or 4. But as one moves through the 100 element array, the total count remaining for each scene (shuffled throughout the array) decreases by one until all 25 elements for each scene has been exhausted. It would be just like shuffling a deck of playing cards. Give each player (of 52 players) one card. It will be one of the four suits, and all 13 cards of each suit will get played out.
  4. I see two executions: curl_exec($ch); $html = curl_exec($ch); I have no idea if that is appropriate.
  5. Start with a standard function equation: (5/2)x + x = y where y is wanting to be 30 + x (5/2)x + x = 30 + x Subtract x from both sides: (5/2)x + x - x = 30 + x - x Simplify: (5/2)x = 30 Rewrite for x: x = 30/(5/2) Solve for x: x = 12 Generally, then: (ODDS)x = Desired_Profit x = Desired_Profit / ODDS x = Bet_to_make
  6. Using HTML5 and CSS3, and jQuery is available. I have a form block enclosing several hidden div blocks. jQuery will unhide a div block on selecting a control node -- presented as a tab. I need to have a form input appear in more than one div block. That is, the HTML has four tabs, each tab making visible one of four div blocks. On one of the four div blocks, a specific form input is present. I need for this specific input to also appear in one of the other div blocks. I want the one input, coded in one of the div blocks, to be "seen" and be operational in another div block -- but not have the HTML code for it located or duplicated there. I thought about adding another input tag with the same name and showing the same value, but that is unworkable as it stands. I do not want to replicate or duplicate or otherwise make two separate inputs. But... My current plan is to have two inputs of the same name, but the input in the hidden div block is disabled. By being disabled, the value of it will not be submitted. When the second div block becomes visible, the first input is disabled and the second is enabled. I would also need to copy the newly entered value into the other same-named input. Could there be a better way? Another way would be to move the specific input outside of the div blocks so that it is always visible. But I do not care to have this input visible for all the div blocks when each becomes visible.
  7. I discovered this a while ago, read up on a number of complaints about it (Filezilla). There is an alternate URL for sourceforge that does not include the "downloader" -- has a &noloader or something like that in the querystring.
  8. Please look at these MySQL Doc pages: http://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_sql-mode http://dev.mysql.com/doc/refman/5.6/en/sql-mode.html#sqlmode_no_backslash_escapes
  9. It's a 'blob' but you seem to be treating/thinking of the contents as a string. While a string can hold non-ascii characters, they will be a problem when trying to print them. They should not be problem when saving the string to a file. When I don't know how my data will affect its container, I base64_encode() it first. But I am not fully understanding what you are doing where you feel the need to escape certain bytes (control codes).
  10. An XML object requires(?) object notation and (maybe?) everything about it, all its nodes, etc, is an object. I get caught frequently when I need the value of a node and forget to cast it as a useable variable type: $wanted = (string)$obj_a->obj_b->obj_c->obj_d; So, I need to keep my wits about me.
  11. Are you setting CURLOPT_RETURNTRANSFER? If so, capturing the results into what? An XML object? Be careful! This word/phrase... will be sometimes this and sometimes that, requiring regex's? I would like to see your results using strpos().
  12. In what file is this statement? var_dump($smarty->getTemplateDir()); My guess: in test.php, there is a new instantiation of Smarty in $smarty, quite possibly overwriting the previously existing instantiation of Smarty in $smarty from config.php.
  13. "If I echo $EmailLen, I get 0." Is this your question: Why? Let's assume $_POST['Email'] is a zero-length-string (-zls-) or is not set at all. That is, nothing was entered into a form field having the name of "Mail" and/or the <form> was not POSTed. (Look at what var_dump($_POST) shows you.) Then, stripslashes() returns -zls-, then trim() returns -zls-, then strlen() returns zero.
  14. The values in $_GET is strange, no doubt. Perhaps spending some time trying to understand why that is happening. In the meantime, this may be a (less-than-ideal) work-around: $tmp1 = explode("?", $uri); // should give array([0] => '/bisi/user/activate-account', [1] => 'email_address=test&token=test') $tmp2 = explode("&",$tmp1[1]); // should give array([0] => 'email_address=test', [1] => 'token=test') foreach($tmp2 as $querystringKeyVal) { etc.
  15. I don't see where the function has been made aware of the variable $todayRepost35. I have seen variables made global ($GLOBAL['todayRepost35']) or passing in $todayRepost35 as a function's argument.
  16. Running the string through base64_decode() returns what looks like, in my opinion, chart data using a certain chart app syntax -- as opposed to a CSV-style of a data set. So, I would think the correct web page (not the /ClientRequest/ URL) will have the javascript necessary to draw the chart with the fetched data.
  17. "socket_getpeername() will return ... in the address parameter" (Emphasis is mine.) The passing by reference into a parameter is one way to return a value. "how is ip2long reading a $clientIP variable that is SET to = [a zero-length string]" Passing by reference allows code that would otherwise not have direct access to the variable's value, to actually change the value of that variable. Having changed the actual memory space holding $clientIP's value with the new value, PHP then gives ip2long() a copy of a valid value (passing by value) from the variable's memory space for do ip2long() to do its thing.
  18. "is not always a simple 'just use this instead'" Hence the experiments of using a wrapper. "Either fix the script, or don't upgrade." Can't fix the script, must upgrade. Hence the experiments. "Honestly, the best thing..." Thank you for your comments, responses, and replies. But I was looking for an actual answer. And so, since I can't find a function that's already been removed for which there is a suitable substitute (even when some massaging of the passed parameters is expected for the actual function or short algorithm), nor is anyone else able to actually make mention of such a function, I will have to experiment with the mysql functions. Not ideal as I was looking for a core function.
  19. The experiment is to create a "bridge" of functions. Said bridge will allow obfuscated scripts to continue functioning for a while longer. Examine the following scenario (and not an invitation to berate the wisdom of maintaining the usage of such scripts): An expensive plugin to an established PHP application fulfills a highly desirable necessity. Certain parts of the scripts are obfuscated or encoded (ionCube/Zend). The publisher has been abducted by aliens. It will be required that the servers be maintained, in part, by upgrading PHP to the most recent versions. Instead of the costly process of "re-inventing the wheel", these experiments will want to show that for the removed functions, the ereg() family of functions for a specific example, which are present in the encoded scripts and are still required, a wrapper function having the same name, but actually executing the suggested replacement function (preg_*() family), will allow the application to continue to use the plugin scripts unabated. I have searched the change log and have not found a function that has been removed for which there is a suggested replacement. "Should just update to mysqli, is not that difficult." I fear you have entirely missed my point. PHP will be using the mysqli extension, but the expensive, encoded/obfuscated scripts will not be converted.
  20. Sorry, I should have mentioned I've been through the changelogs. I've scanned the Backward incompatible changes for all 5.x versions and have come up empty.
  21. "#result2 is returning "1". What does 1 mean? True?" When attempting to print a boolean value (true, false), PHP (I assume) converts them to a string that the equivalent printable value is '1' for true and a zero-length string for false (you might think it would be '0' (zero), but no). Why is socket_getpeername() returning a boolean? If a parameter is being passed by reference, the value assigned to that parameter is your actual return.
  22. We know that soon, a number of functions will be removed from PHP. There are Deprecation Warnings. I would like to make experiments with functions that have already been removed, and that have suitable substitutes. For example, the ereg() family of functions and the split() function have a suitable substitute in the preg_*() family of functions. Was there a simple, common function that was available in the core PHP build that is now actually removed as of PHP 5.4 (PHP 5.5, perhaps?), where another function can be used to simulate it? I was thinking of the mysql_*() functions, but these functions, although deprecated, are made available by simply including the extension in the PHP.INI file (as I understand it). That is, I have the mysqli extension and not the mysql extension loaded. Thus, the mysql_*() family of functions is not available. So I would experiment to see what would happen if I created a 'wrapper' function named mysql_connect() with mysqli_connect() inside. I am wanting to make this kind of experiment with a core function, like split(), that is already removed.
  23. Allow me to make an assumption without checking the manual on any of it: * socket_getpeername() is taking it's second parameter by reference. Thus, there should be something to reference (a zero-length string)
  24. WHILE($rows = mysql_fetch_array(query)): Can you tell us what query is? Specifically, query without the dollar sign that, if present, would indicate it is a variable?
  25. I would think that this is only valid to explore the possibilities if all other aspects are identical. Such as the method of communication between their machine (T) and your machine (Y). (This reminds me of New York stock broker infrastructure where the distance of fiber-optic lines determine whether an interloper can leap ahead on a trade.) If all that Y does is answer API calls -- which you should be able to control what type of data is acceptable and what the response will be -- then maybe a XAMP stack is not your solution. Maybe something far more dedicated and specialized?
×
×
  • 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.