Search Results

Search found 3 results on 1 pages for 'alexeymk'.

Page 1/1 | 1 

  • What are the precise rules/PHP function for encoding strings into POST arrays?

    - by AlexeyMK
    Greetings, Just getting into PHP web development. I've got an HTML form where a user checks some series of dynamically-generated checkboxes, and submits via POST. On the PHP side, I want to check which of the check-boxes were clicked. I have an array $full_list, and am doing something like $selected_checkboxes = array_filter($full_list, function($item) { array_key_exists($item, $_POST); } I run into problems when a list item is named, for example "Peanut Butter", since in the POST array it is named "Peanut_Butter". I could certainly just str_replace " " with "_" before checking array_key_exists, but I imagine that there is a more fundamental encoding problem here; specifically, I'm not sure of exactly what layer transforms normal strings in HTML Forms (value="Peanut Butter") into "Peanut_Butter". So: what layer is responsible for this conversion? Is it the browser? what are the exact conversion rules, and is there a PHP function out there that will replicate that exact conversion? Thanks!

    Read the article

  • Using Regex groups in bash

    - by AlexeyMK
    Greetings, I've got a directory with a list of pdfs in it: file1.pdf, file2.pdf, morestuff.pdf ... etc. I want to convert these pdfs to pngs, ie file1.png, file2.png, morestuff.png ... etc. The basic command is, convert from to, But I'm having trouble getting convert to rename to the same file name. The obvious 'I wish it worked this way' is convert *.pdf *.png But clearly that doesn't work. My thought process is that I should utilize regular expression grouping here, to say somethink like convert (*).pdf %1.png but that clearly isn't the right syntax. I'm wondering what the correct syntax is, and whether there's a better approach (that doesn't require jumping into perl or python) that I'm ignoring. Thanks!

    Read the article

  • Serve external template in Django

    - by AlexeyMK
    Hey, I want to do something like return render_to_response("http://docs.google.com/View?id=bla", args) and serve an external page with django arguments. Django doesn't like this (it looks for templates in very particular places). What's the easiest way make this work? Right now I'm thinking to use urllib to save the page to somewhere locally on my server and then serve with the templates pointing to there. Note: I'm not looking for anything particularly scalable here, I realize my proposal above is a little dirty.

    Read the article

1