Jump to content

bsmither

Members
  • Posts

    213
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by bsmither

  1. 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.
  2. 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.
  3. 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
  4. 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).
  5. 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.
  6. 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().
  7. 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.
  8. "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.
  9. 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.
  10. 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.
  11. 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.
  12. "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.
  13. "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.
  14. 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.
  15. 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.
  16. "#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.
  17. 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.
  18. 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)
  19. 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?
  20. 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?
  21. I like to use: if(!empty($_FILES)){ foreach($_FILES as $file){ // figure out what the array $file contains } }
  22. Stipulated that there is worth to good advice. Everyone should be glad it was given. But I do not know the whole picture. I have no context, no history. I am not his mother, nor his priest. I cannot determine what he will do with the answer, nor judge him for asking for it.
  23. It is a curiosity to me to know if PHP would ever get confused and consider the keys as integers. Hopefully not, then maybe a ksort($myarray) might let PHP find the key faster. But I really do not know.
  24. This literal string (part of the entire string) is what you will be sending to the database: "VALUES ('first_name','last_name','email', SHA1('pass'), NOW())" The SHA1() and NOW() are real MySQL functions. So, SHA1('pass') will have the MySQL database engine use the string literal pass and make a 160-bit checksum from it. Now, you are wanting to use $_POST['pass'] instead of pass. So, let's try: SHA1('" . $_POST['pass'] . "'),
  25. You could not duplicate the statement to get that error. I put on the table an irrational theory. When you remove the impossible, whatever remains, no matter how improbable, still must be tried.
×
×
  • 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.