Your Ad Here

My site does not validate

Digg This Story

And it never will.

The link is still down there, and if you read through all the errors, you will see that I coded my site using valid XHTML, but the plugins are not valid. But hey, guess what? My site looks the same in Opera 9.5, Opera 9.2, Firefox 2, Firefox 3, IE6,7,8, Safari 3.x, and Konquerer.

That’s valid enough for me!

Tags:, ,

Digg This Story

Flash is open source… nothing has changed.

Digg This Story

Simply put: Flash will not replace well-designed web sites based on html/css. To elaborate:

Saw this gentleman’s article on Technorati, and the title caught my attention.

Adobe recently announced that Flash and related files are going to be open source. This means that pretty much anyone can write and develop a program to author flash files. So what? This changes nothing.

My honest opinion is that the argument of Flash taking over the standard web page is moot. There are practical, well executed uses of flash, and there are practical, well executed uses of any of the other technologies mentioned. However, it seems that there are at least as many poor uses of each.

Flash has it’s place: Interactive, colorful, design-rich web applications, games, demontrations, advertisements, web intros, and so on. The key is that flash files use up bandwidth and computing power, and if used when not needed, can actually harm the user experience and usability. Flash files are also not indexed in search engines, which means that in order to have the page relevant on the web, the designer/developer must include additional content indicating what is contained in the flash movie/video. If the entire site is in flash… then no search results.

AJAX has simliar problems, and should be used when appropriate. The large-content AJAX staple “iframe” won’t be indexed, and users without javascript enabled (many office computers, terminals especially) cannot use the AJAX content at all. This means that developers must write code twice: Once for the general population, and again for those that can’t use the technology. Either that, or they stand to lose 1 out of 10 potential users of their software.

I hate flash. I hate how easy it is to make a really ugly navigation menu in flash. I hate how easy it is for anyone who … Let me interrupt myself here. I hate that because I have a web page open in the background that has a flash movie running, my browser just shut down, and I lost two sentences that I wrote because of it. I hate that 90% of flash applications could have been done better, faster, and cleaner using web standards, and without alienating those with slow computers, or those who can’t install flash at their office.

But just remember: I love a great looking flash-based website. Just a random search on google found me this site: http://www.singularitydesign.com/ . Very well done. The flash file is only 202K, which is much smaller than even the Yahoo! homepage. The content is clean, and flash is used to show off how flashy this particular web design company can make your site look.

Simply put: Flash will not replace well-designed web sites based on html/css.

Tags:, , ,

Digg This Story

Simplified PHP $_POST data handling

Digg This Story

When posting data from a form to a page, the $_POST variable gets set to an array similar to this:

Array ([name] => “daniel”, [state] => “illinois”, [phone] => “630-618-9588″)

Now, one way to process this is to know in advance (which, normally you will), what the values will be, and set them to more usable variables. For example:

$newclient["name"] = $_POST["name"];
$newclient["state"] = $_POST["state"];
$newclient["phone"] = $_POST["phone"];

Now, for a simple form that only has one or two values, that’s fine. The code is clean, easy to read, and it gets the job done. Now, if you have a more complex form, the array may look more like this:

Array ( [lastname] => costalis [firstname] => daniel [MI] => g [lastnameguardian] =>
kolar [firstnameguardian] => maureen [MIguardian] => p [Month] => 10 [Day] => 05 [Year]
=> 1983 [Age] => [address1] => 445 n ardmore ave #k [address2] => [city] => villa park
[state] => IL [zip] => 60181 [phone1] => 6306189588 [phone2] => [phone3] => 6306189588
[email] => costalis.dan@gmail.com [feet] => 5 [inches] => 10 [pounds] => 165 [hair] =>
Brown [eyes] => Green [union] => Yes [experience] => None [skills] => Jumping [notes]
=> Great Guy [submit] => Add Client )

You can copy and paste 31 times, and edit all the values if you want… or, write something that will do it for you. (read: copy and paste my code and edit it to your needs) This particular set of code is designed to update a mysql database, but can be modified to your liking. the “safedata” function is to prevent hacking of your database.

function safedata( $string ) {
    return "'" . mysql_real_escape_string( $string ) . "'"; //add needed slashes,
enclose data in quotes.
}
foreach ($_POST as $field => $value) //Count through each post item
{
$fields[] = $field; //add current field name to fields array
 $values[] = $value;//add current field value to value array. Will have same index
as its field name
}

$query  = “INSERT INTO `SomeTable` (”; //Start of MySql query

foreach ($fields as $fieldname) //for each field name
    $query .= “`” . $fieldname . “`,”; //add field to list in query. safedata not
needed… you supplied the names

$query = rtrim($query,”,”); //trim off extra comma after final value
$query .= “) VALUES(”; //close off field names, begin listing values

foreach ($values as $valuename) //for each value corresponding to its field
    $query .= safedata($valuename) . “,”; //add value to list
$query = rtrim($query,”,”); //again, we have an extra comma
$query .= “) ;”; //end query string

$result = mysql_query($query); //excecute query
 // created by : http://www.whathuhstudios.com/press : attribution may be removed and
is not required

You could easily use this to assign the values to an array of your liking, or whatever you like. Either way, this is a nice easy way to deal with large form submissions without the use of a PHP framework. Do what you want with this code, and if you happen to include a link to my site on your site, or leave me a comment… then so be it. Hope this helps someone.

Tags:, , , ,

Digg This Story

Blackberry Flip Phone!

Digg This Story

Research in Motion has finally decided to make the step into the mainstream with their first ever flip phone! Codenamed the “Kickstart”, it is expected to be released before the end of 2008. It has everything you would expect from a next-gen flip phone: Included camera, bluetooth, bright colorful display and external display. Navigation will still be done with the trademark trackwheel introduced with the Blackberry Pearl. Photos are courtesy Boy Genius Report.

Tags:, , , , , ,

Digg This Story

header, section, article, footer and html5

Digg This Story

HTML5 introduces new tags that make a lot of sense. No longer will each divison of a page need to be speculated as to its purpose; the new tag names have it built right in. I’m going to take a look at what these two tags mean, and how to implement them. Note: This article will be written based on current drafts, and implementation and definition are subject to change.

Header: The <header> tag defines the header of a section or document.

Section: The <section> tag defines sections in a document. Such as chapters, headers, footers, or any other sections of the document.

Article: The <article> tag defines external content. Such as a news article from an external news provider, or text from a web log (blog), or text from a forum. Or any other content from an external source

Footer: The <footer> tag defines the footer of a section or document. Typically contains the name of the author, the date the document was written and/or contact information.

It all seems pretty self explanitory. As of now, an overly simplified version of a blog layout may look like this:

<div id = "header">Blog title, blog links, and so on </div>
  <div id = "content">
    <div class = "post" id = "1">Post content</div>
    <div class = "post" id = "2">Post content</div>
    <div class = "post" id = "3">Post content</div>
  </div>
<div id = "footer">footer content, links, copyright</div>

This, of course, is not the complete page, but you get the idea. Once html5 is adopted, it will appear more like this:

<header>Blog title, blog links, and so on </header>
  <section id = "content">
    <article id = "1">Post content</article>
    <article id = "2">Post content</article>
    <article id = "3">Post content</article>
  </section>
<footer>footer content, links, copyright</footer>

That doesn’t seem so hard. In fact, I bet I could “upgrade” an entire WordPress theme in about an hour to html5 syntax. What does this mean for developers? Well, the truth is, absolutely nothing right now. HTML 5 is not supported in current browsers, and probably won’t be for some time. Opera 9.5, Firefox 3, and Safari 3.x include a handful of html5 features (namely the canvas element), but none of these tags above.

What it means for the future, is simply web pages that make more sense; easier readability. Also, with the same content, there are 30 less characters that needed to be typed. 30 bytes times 1000 means 30 megabytes of bandwidth saved per thousand page loads. This will also mean cleaner and easier to read stylesheets. Overall, pages like a standard blog page will just be much more efficient. This is great news for developers and end users alike.

Sources: http://www.w3schools.com, http://blog.whatwg.org/, http://www.w3.org/html/wg/html5/

Tags:, , , ,

Digg This Story

Pages (11): [1] 2 3 4 » ... Last »