Jump to content

LLLLLLL

Members
  • Posts

    306
  • Joined

  • Last visited

Everything posted by LLLLLLL

  1. I just found code that does this: orig = orig.replace( "<br>", "<br>" ); orig = orig.replace( "<BR>", "<br>" ); orig = orig.replace( "<bR>", "<br>" ); orig = orig.replace( "<Br>", "<br>" ); I see why it's done this way (to encompass any caps variation on the BR) but since .replace() will only get the first instance, this is just bad all the way around. Also, there's no way to do a toLowerCase() because that will mess up the rest of the string. Is there some sort of JS regex way to replace all instances of <br> regardless of the caps? Thanks!
  2. Agreed. No notifications. Also, posting a topic is EXTREMELY slow.
  3. You cited the load errors list for: But that doesn't really help answer the question. There IS NO ERROR because $_POST and $_FILES are empty. I realize this is potentially a server issue, but a customer had this issue. Is there any way to know that a post was attempted?
  4. I tried to edit the original post to no avail. Here's clearer information: My test for now is simple... test upload a small image file, it's fine. But I have set my max file size to 16MB in php.ini, and I'm intentionally uploading a 19MB file. What is the expected result? Here's what I've found: 1) If the php.ini post size ( 8 ) is smaller than the max file size (16), $_POST is empty and so is $_FILES. There's no way to get an error 2) If the php.ini post size (20) is larger than the max file size (20), $_FILES[ 'whatever' ][ 'file' ] gives me a correct result. Is there a way to get an error that helps a user in scenario #1?
  5. I'm trying to test error conditions for file uploads, but when a file intentionally fails, I'm not even sure how to access the code. Here's a snippet: $file_arr = $_FILES[ 'digifile' ]; $fn = $file_arr[ 'name' ]; $temp = $file_arr[ 'tmp_name' ]; $error = $file_arr[ 'error' ]; error_log( 'the error is: ' . $error ); // ** SEE NOTE BELOW if ( $error > 0 ) { $ui->upload_message = "Error during file upload. "; // try to switch the error to show a relevant message } else { if ( move_uploaded_file( $temp, $full_path ) ) // something } My test for now is simple... test a small image file, it's fine. But I have set my max file size to 16MB in php.ini, and I'm intentionally uploading a 19MB file. What is the expected result? Well I can tell you that the result is this code IS NOT REACHED AT ALL! How is that possible? error_log() doesn't get reached. I don't really know what happens when there is an error, but I'd like to show a customer a relevant message if this happened in the real world. There's no boolean result of move_uploaded_file, either, since like I said THE CODE ISN'T REACHED. I really don't understand. Any help is appreciated.
  6. Sorry, another question on this, because I'm not sure I asked it correctly the first time: The database column is currently latin1_swedish BUT the encoding used by the application's mysql connection is UTF-8. This is why I was wondering about needing to convert data before converting the column.
  7. You mean I just have to alter the column type and the conversion occurs automagically?
  8. I've been given a database where some text columns are using latin encoding (or swedish? ugh). I want to update these columns to utf encoding while preserving the data to be accessed correctly after the column type is changed. What are the steps? Do I convert the data FIRST and then alter the column encoding type? Or vice-versa? Or something else? Also, is this the best way to update the data? convert(cast(convert(column_name using latin1) as binary) using utf8) Thanks
  9. Thanks
  10. Yes, that definitely works, thanks. But in general, let's say no "enable/disable" option exists, how would I add and remove (in this case) the "sortable" function? Just curious for future reference. Thanks.
  11. I'm using http://api.jqueryui.com/sortable/ and I'd like my table to be unsortable by default, a user clicks something, and then it's sortable, then they click something else and it's not sortable. I thought I could use these two functions: function enable_sort() { $( ".btf_table tbody:first" ).sortable({ helper: fixHelperModified, stop: updateIndex, axis: "y" //handle: '.handle' }).disableSelection(); } function disable_sort() { $( ".btf_table tbody:first" ).off(); } I can use them, but then I cannot use "enable_sort" again after "disable_sort" is called. I'm sure I'm mis-uisng the "off" function but I'm not sure what I'm supposed to be calling instead, or with which parameters.
  12. What is the exact code? As I mentioned, I have already tried scrollTop and various others. None of them worked. If I want to scroll to the xyz row, what is the code?
  13. The HTML is below. I'm struggling to find an easy jQuery way to scroll to a given row (classes abc, def, xyz). I've tried various versions of scrollTop, offset, offsetParent, and more. All to no avail. The cart_item_wrapper is 150px tall, and it exists to allow the "cart_items_table" to show its items in a scrollable manner. What is the best way to scroll to a div in a div? <div id="cart_item_wrapper"> <table id="cart_items_table"> <tbody> <tr class="abc" style=" "> <td class="icon_col"></td> </tr> <tr class="def"> <td class="icon_col"></td> </tr> <tr class=”xyz”> <td class="icon_col"></td> </tr> <tr> <td class="icon_col"></td> </tr> <tr> <td class="icon_col"></td> </tr> </tbody> </table> </div>
  14. OK. I couldn't find anything else on that site either but I thought I'd ask. Thanks.
  15. Well yes, that works for the PHP side of things. I was just curious about the command itself, wondering if it's possible to get a different output.
  16. How can I declare the name of the output column with a "show tables" command? The default result is Tables_in_your_database_name How can I change it to be something else? "show tables as TBL" doesn't work. Is there something similar?
  17. I don't think magic_quotes was ever turned on because the customer is using HostGator and they generally have that ridiculous option turned off. There's not a chance it's a stripslashes coding issue because there's no code that changes every TEXT column in the entire database; the fact that everything changed at once seems to lead me to some sort of export/restore thing. Not sure what the guy did. I guess it is a mystery to us all.
  18. The product is installed on the customer's server; I don't control the data. They can destroy the data in any way they please with standard cPanel tools. Apparently they did. I'm looking at their data with phpMyAdmin.
  19. Yes, Jessica. But that's not the question. And \r\n is not what's in the database. "rn" is in the database. I'm wondering how it got there.
  20. A customer of mine has a database that is now filled with "rn" characters all over the place. These characters exist where the fields in question used to have blank lines. I'm assuming the customer did some sort of backup/restore or something. The problem isn't isolated to a single table or column; it is every text column in every table. At this point it's all fixup, but I'm wondering how this happened. The customer "has no idea" but I think they are afraid to admit the problem was self-inflicted. But out of my own curiosity, I'd like to know how this type of damage is even possible. Do you think there is some bad setting on the export or import that would have done this? Any other ideas how someone created this issue?
  21. I believe you mean the programmer who added magic_quotes to PHP was horrible. It's the most absurd "feature" in any programming language.
  22. The original web host IS horrible, so yes, the data has slashes in it. The horrible host is why the customer is switching in the first place. It will really, really suck to have a script go through each column of each row of each table. Is there no "magic" way to do that?
  23. I need to import a customer database from their site -- with magic quotes enabled -- to my system, where magic quotes are disabled. When I export the customer DB from their site, obviously all the data contains the magic quotes. What is the best way to get rid of the quotes? 1) Import into my system and then run [something]? 2) Do some massaging of the export text file prior to import? 3) Something else? For what it's worth, I'm using a standard cPanel with PHP MySQL Admin tools.
  24. Well as I said before, the "standard way" or "right way" is not an option here. There are two different technologies on one page, and they each have their own stuff going on. I'm not a fan of these cookie-cutter theme things that require so much nonsense (when CSS is truly all that was needed). But this topic is solved.
  25. Yeah, the "standard way" isn't an option with this silly theme. I removed noConflict and cleaned up a couple other things. Working now. Thank you.
×
×
  • 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.