Skip to main content

Posts

Showing posts with the label html

Can something "bad' happen via img src?

I know, I know, title is quite bad, but I'll try to explain what I mean here. So, I ask my members to show their photos. They upload it somewhere, then paste their photos' URL into input and I save it to my database (MYSQL). Then, the photo is being seen on their profiles. I get the URL from database and do something like that: <img src="<?=$photo;?>" height="123px" width="123px">"> where $photo is URL taken from MYSQL. Is it totally safe? Can somebody upload for example .php file and harm my website? Do I need to check if URL's ending is .gif, .png, .jpg?

Progress Bar Filling - jQuery Implementation

I'm implementing my own Progress Bar using jQuery. My question is how can I fill (for example) only 30% of it with a background ? What are my options ? Basically, the Progress Bar is a simple div with rounded corners (-moz-border-radius). I'm using Firefox 3.6.3.

How not to lose focus on a login page

I have a simple login form with 2 input fields: "username" and "password". "username" field is focused by default. The problem is that when user clicks outside "username" or "password" fields, the focus is gone (it is neither on "username" nor on "password" fields"). How can I force the focus to be on these 2 fields only ?

Most elegant way to force a TEXTAREA element to line-wrap, *regardless* of whitespace

Html Textarea elements only wrap when they reach a space or tab character. This is fine, until the user types a looooooooooooooooooooooong enough word. I'm looking for a way to strictly enforce line breaks (eg.: even if it results in "loooooooooooo \n ooooooooooong").

How to print on already printed paper from a webpage?

i have already printed pages of A4 size in printer image is attached! now i want to print data in blank fields from webpage any one guide me how to achieve this?

Exclusive CSS for iPhone/Android

I'm making a mobile-friendly stylesheet for a page of mine. Is there a simple way to make it show that stylesheet to iPhone/Android users? Or do I have to pull the user-agents and figure it out that way - and how do I do that?

What is xhtml"s role attribute? What do you use it for?

I have read w3's page on this here , but it is still vague to me. Is the role attribute's purpose to clarify the code? Or will it be interpreted by some browsers or spiders? Can it be used as a dom selector using some javascript libraries (I am thinking that since the id attribute has to be unique, this could be use to identify multiple resources on a page)? Source: Tips4all