Posts

Showing posts with the label html

ASP.NET | Convert URL to Image

Image
New feature available: URL2IMAGE Convert HTML URLs to PNG format on the fly using this ASP.NET Class Library. More details at http://codecanyon.net/item/url2image-aspnet-module/4508641

HTML | Firing submit button

Problem Editing one or multiple textboxes in a page won't execute the correct button in the form.   Solution Once we make sure our button, textboxes, and others, are wrapped within a "Form" tag, various things will work right away. - Hitting the "Enter" key will fire the first available button with "submit" type - Textbox values will be available by the receiving event handler of the POST - If various submit buttons exist, we may need to tell each textbox, which button should be fired when we hit enter on it      // button action on input enter $('input').keypress(function (e) { if (e.which == 13) { e.preventDefault(); $(this).next().trigger('click'); } });

[Web] Render html files as php files

Case: You have an html page and you have no access to server side code. But, since you're hosted on a server that supports php, why not render htm/html file extension with phpengine, so you can write php server side code? Problem: Doing this is possible, but can be tricky, specially using third party hosting companies such as godadd.com. First, you need to get them to enable the htaccess file that allows you to add web server rules. Then you need to use AddType to configure html mime types to be rendered as php. Solution: - Retrieve .htacces file from the ftp server - Rename or delete the .htaccess file from the ftp server (overwriting the existing one may not work) - Configure your file for ASCII format, and add these lines: Options +ExecCGI AddType application/x-httpd-php5-3 .htm .php AddHandler x-httpd-php5-3 .htm .php - Upload the .htaccess again, to the ftp server, and give it +777 permissions - Use or create an html page with php code and watch it render ...