Jump to content
Larry Ullman's Book Forums

Larry

Administrators
  • Posts

    5413
  • Joined

  • Last visited

  • Days Won

    155

Posts posted by Larry

  1. This kind of problem is a PITA to debug b/c it could come from several places: the value stored in the database, the value retrieved from the database, the value put into the HTML, or the value displayed in the browser. I don't think you want to go to some converter method; it's best to solve the actual problem. I'd start by confirming how the values are stored in the database. Make sure the database is using UTF8 everywhere, especially on the specific table and column. Make sure you're using UTF8 when connecting to the database, both directly and from PHP. And then make sure your HTML page uses UTF8, both in the HTML encoding and in the encoding used by your IDE/text editor when saving the file. 

  2. Sorry about the delay and thanks for reminding me! The solution here isn't immediately obvious so I had to hunt around a bit. It looks like the write session function is what comes into play here (per the PHP manual), but that method returns true, assuming we're looking at the same script. This is a wild guess, but does it get fixed if the close session function is changed to   

    mysqli_close($sdbc);
    return true;

     

  3. I don't know the answer to this one off the top of my head. You might be able to use imagmagick or gimp? I really don't know whether this would qualify as OCR or not? I imagine you'll need to find some software that runs on the server that can do the work, then upload the image via PHP and call the software via PHP through an exec() command. None of this would be easy or obvious.

    If you already have a JS library that works for the reading of the image, can't you just have JS do the math, too?

  4. This is very good detective work and thanks for being so thorough. I'd start by ruling out cases 3 & 4, though. The links are going to come through with HTML entity versions, so %26. You'll never have & in the URL, so there's no need to test and handle that. I'm also not inclined to go to zero-width positive lookahead assertions; that'd probably just complicate things. 

    I just did an online regex tester for case 2 and it matched the percent okay: https://regex101.com/r/AWJdX3/1/

    Are you restarting Apache after making changes to the configuration?

  5. Okay, so this kind of thing is a bit tricky. Since you have multiple inputs that are all arrays of related records, I'd start by changing your naming scheme to make them all more overtly related. For example, you'd want exams[X][subject] and exams[X][grade]. If i'm following you on this. I'm not sure I am 100%. But the key is to make the association of the data overt like that. Let me know if it's still unclear.

×
×
  • Create New...