html

php login code problem

Hi, I'm using this code for login, but when I enter a username and password it just loads the page and the login page again is displayed. Why does this happen? <?php session_start(); if(!isset($_POST['username']) || !isset($_POST['password']) || empty($_POST['username']) || empty($_POST['password'])) { ?> <html> <h...

How dangerous is it send HTML in AJAX as opposed to sending JSON and building the HTML?

It seems to me that any interception of this could provide instant trouble because anyone could just send any HTML/script back to the client. The only reason I'm interested in doing this is because of the huge pain it is for front-end developers every time there's a DOM structure/CSS change so you now have to go figure out where in the ...

Setting a multi-valued parameter in javascript

Hi, When I submit a form in HTML, I can pass a parameter multiple times, e.g. <input type="hidden" name="id" value="2"> <input type="hidden" name="id" value="4"> Then in struts I can have a bean with property String[] id, and it'll populate the array correctly. My question is, how can I do that in Javascript? When I have an array, a...

Render PDF in iTextSharp from HTML with CSS

Any idea how to render a PDF using iTextSharp so that it renders the page using CSS. The css can either be embedded in the HTML or passed in separately, I don't really care, just want it to work. Specific code examples would be greatly appreciated. Also, I would really like to stick with iTextSharp, though if you do have suggestions...

G-mail style form submission on table data

I have table rows of data in html being filled from a CGI application. I want each row to have a check box next to it so I can delete multiple rows, just like in gmail. I figured out the basic text form and was able to send it to the CGI program to delete the row, but I don't want to have to type in the row name to delete a single fil...

Apostrophes replacing quotation marks in script tag in input field.

I have this input in a form: <input type="text" value="<script src='/js/script.js' type='text/javascript'></script>" name="embed"/> The quotations in general have to be double, so I put single-quotes within the value property. However, when I do that, the result is: <script src=’/js/script.js’ type=’text/javascript’></script> Not...

Open Source HTML to PDF Renderer with Full CSS Support

I asked about getting iTextSharp to render a PDF from HTML and a CSS sheet before here but it seems like that may not be possible... So I guess I will have to try something else. Is there an open source .NET/C# library out there that can take HTML and CSS as input and render it correctly? I must reiterate... the library MUST be free...

C# PDF Printing Library

Are there any free libraries that would "print" to a PDF without actually having to install a PDF printer on the system. I want something that can be completely self contained in my application. The reason I say I want it to "print" is that I've tried and tried to find a solution for directly converting from HTML with CSS to PDF, but i...

Regex for links in html text

Hi, I hope this question is not a RTFM one. I am trying to write a Python script that extracts links from a standard HTML webpage (the <link href... tags). I have searched the web for matching regexen and found many different patterns. Is there any agreed, standard regex to match links? Adam UPDATE: I am actually looking for two diffe...

HTML2PDF Conversion

We're developing software for both Linux and Windows that requires CVS files to be generated into PDF reports. I've written a program in C to turn the CVS files into HTML files (td, tr etc.) and am then converting the HTML into PS using html2ps and then ps2pdf under Linux. However as mentioned above we're also developing for Windows an...

Swing components inside HTML

Does anybody know of a pure java (ar at least cross platform) open source component/library which displays HTML which can contain swing components inside it? All I could find were either abandoned or incomplete. I am asking because I'm thinking about trying out approach to do use this combination for creating desktop application. EDIT...

Displaying a Django query result in HTML - table, list, css divs?

I am working on an django application that will return what historically was a table of information: ISSUE DESCRIPTION INITIATOR INITIATEDDATE ASSIGNEE FORECASTDATE STATUS REMARKS That will be the entrance point for users to sort / filter, etc the list of issues. The columns like ISSUE, DATES, NAMES are of relatively fixed widt...

Linked drop down lists and load div

Hello ! I`m kind of new when it comes to programming but am trying to learn. What I need to do for my site is have 2 or 3 linked drop down menus so when I select an item from the first one, the second one will refresh with other options. I have found a way to do this using java but I cannot seem to make it with the refresh div part. I l...

How to store arbitrary data for some HTML tags

I'm making a page which has some interaction provided by javascript. Just as an example: links which send an AJAX request to get the content of articles and then display that data in a div. Obviously in this example, I need each link to store an extra bit of information: the id of the article. The way I've been handling it in case was to...

How to create a table inner bevel in HTML/CSS?

I'm designing this forum layout where I come up with a nice design to draw the forum tables, however, I'm not sure that this can be easily done in HTML/CSS. Before I continue to draw the whole layout, I need to know if this is achievable and how, otherwise, I'll have to ditch this effect and rethink things... For instance, the design I...

Is there a way to rotate text input?

I have to align a textbox and some text, at about 30 degrees, like this: I would like it to work at least in IE and FF. everything I found on the net deals with image rotation. Anyone? ...

Why does contentEditable element reject the Enter key?

Hi, I'm using an application that embeds IE control to show content. I change that content to contain a <div contentEditable="True">Hello World</div> element. This works well and I can edit the content of this div, but pressing Enter is rejected with a beep. When I add a textarea element to that page the Enter key works and I can add l...

Will HTML 5 validation be worth the candle?

It's widely considered that the best reason to validate ones HTML is to ensure that all browsers will treat it consistently and predictably. The HTML 5 draft, however, contains two specifications in one. First an author spec, describing the elements and attributes that HTML authors should use, and their interrelationships. Validation ...

Do you think templates represent the best way for separating presentation logic from business logic?

I think most template engines are hard to use for designers and front end developers leaving you, the programmer with the burden of maintaining them. And frequently updating the templates after the designer updates the html mockup is a nightmare because your templates are no longer compatible with the original htmls. I had this problem...

Turning numbers into colored bars automatically in HTML/Javascript

Hello, I want to auto-generate a HTML table from some custom data. One of the columns in my data is a number in the range 0-100, and I'd like to show it in a more graphical way, most desirably a colored horizontal bar. The length of the bar would represent the value, and the color would also change (i.e. below 20 it's red, etc.) Someth...