Monday, 9 January 2012

Your tutorial "Multilingual Web Pages Via PHP, Arrays And MySQL" is really very useful for me.So, thanks.I just want to ask a question,in your tutorial to exampled three languages’en,fr,sp’ but i want to add more than three languages.Is it possible?

Sure. The methodology works for any number of languages; just make the right number of keys and keep the translations in order.

Ask me anything

Sunday, 1 January 2012

Tumblr Mangles Developer Relations

Last week I logged on to Tumblr and was confronted with this abomination:

missing e notice from tumblr

Missing e notice from tumblr. Way to encourage API development, guys.

Needless to say, this is pretty disturbing, and I wonder what Tumblr is thinking by posting this.

Continue reading: Tumblr Mangles Developer Relations »

Sunday, 25 December 2011

Parent-Child DropDownList Controls In ASP.NET Web Forms (VB.NET)

Some time ago I promised a formspring anon I would do a tutorial on parent / child DropDownList controls in ASP.NET Web Forms. At long last, I’m delivering. (From here on out, I will use “DropDownList” and “select list” interchangeably.)

Parent-child DropDownList controls means you have a parent, or main / master select list. Based on whatever selection is made in that first DropDownList, a second, “child” or “detail” select list is populated with relevant results.For example, if we had a database of cars, we might have a parent (master) DropDownList of manufacturers — Ford, Chevy, Toyota, etc. — and populate the child DropDownList with models from the selected manufacturer. So, if someone chose Ford in the parent select list, the child select list would automatically populate with choices such as Fusion, Mustang, Explorer, F-150, etc.

I’ll be demonstrating two different ways to accomplish this task, as well as a few variations on the first: First, binding with only SqlDataSource controls, which is by far the easiest way to proceed and will suffice for about 90 percent of applications; second, using code behind and CompareValidator controls, to cover all possible roadblocks.

Some notes before we proceed:

  • I’ll use the ZIP Code database I’ve been using for a while as the back-end data. I also have a separate table of USPS state codes I’m using as the parent data, to help illustrate that you can use several tables / data sources to fuel this solution, provided the keys that relate the data make sense to each data store. In other words, you can use a lot of different sources for your data, so long as the data is relational.
  • I’m going to use SQL Server, stored procedures and a connection string stored in my web.config file to access my data. I recognize that some people prefer to use SQL statements / LINQ and the like, or can only use Access / MySQL or other data stores. I really urge you to always use stored procedures, as they are way safer than inline SQL statements. As far as alternative data stores go, that should be a easy a fix as switching your code to use to the relevant ADO.NET ODBC classes, rather than the SQL Client classes.
  • This solution should work for ASP.NET versions 2.0 forward.

Continue reading: Parent-Child DropDownList Controls In ASP.NET Web Forms (VB.NET) »

Saturday, 24 December 2011

I’m Sticking With GoDaddy For The Right Reasons, Even If They’ve Done Wrong

Call the headline to this article overwrought, if you like, and you’ll be correct. But the way I view business is, you have partners, and the relationships you have with those partners are a balance.

If you’re a freelance coder and you’re not putting the same kind of thought and consideration you use in personal relationships into your business partners, you’re going to get burned. Because as it is with friends and lovers, you get out of customers and vendors alike exactly what you give.

I’ve put a lot into GoDaddy, and they’ve given me a lot back. That’s why, even though GoDaddy initially supported the Stop Online Piracy Act and only recanted under threat of boycott, I’m going to keep doing business with them.

For those in the dark and the benefits of post-event context, SOPA is a bill, before Congress at this writing, that would give broad censorship powers to the Department of Justice, ostensibly to block incorrigible copyright violators. It’s envisioned as a way to get the repeat scofflaws who are largely undeterred by the Digital Millennium Copyright Act (DMCA), which clearly has been almost completely ineffective at stopping brazen file sharing.

Continue reading: I’m Sticking With GoDaddy For The Right Reasons, Even If They’ve Done Wrong »

Friday, 23 December 2011

Hi Doug, “Sorting Your MySQL Results Set In PHP Using jQuery” is perfect for what I need, thanks.The cursor changes to an “I” beam rather than a hand when hovering over a column heading – can this be altered to show a hand for the clickable heading?

You can use CSS and the hover pseudoclass:

#sortedtable thead th:hover {
    cursor: pointer;
}

Ask me anything