jeffguthrie.com

This website is my corner of the web to write about things I find interesting, post pictures, and the occasional video. I recently got a new job working in Flash full time so expect more on that subject.

Secure way to pass a value to a Form field with PHP

Jeff March 30th, 2009

Recently I worked on a project where I had to pass a value from one php page to another. It was very simple and I had it working but didnt think about the security around this functionality as I am still fairly new to php. The biggest issue is to make sure someone cant inject code into the field and mess up your site. Most examples I saw didn’t include this security check, so here you go.

1
2
3
4
5
6
7
8
9
<?php
	//grab email that is passed in from a page
	if (isset ($_GET["email"])) {
	        //htmlentities removes quote characters and html characters from the value passed in
		$email = htmlentities($_GET["email"], ENT_QUOTES);
	} else {
		$email = '';
	}
?>

And here is the code you use to send the value to the page:

<form name="myForm" action="submitForm.php?email=+document.getElementById('emailField').value);">
...
<input type="text" name="emailField" id="emailField" value="email goes here">
<input type="image" src="images/submit.jpg">
</form>

Thanks to PlanetKodiak for the help with this.

Firefox Search Add-ons

Jeff March 27th, 2009

Here are a few plugins that can help you find the information you are looking for faster by adding a couple add-ons to Firefox.

Context Search 0.4.3: This is a very handy add on that after you highlight a word on the page, you can search specific sites. Make sure you have added more than the default search sites here.

Search Cloudlet:
When you perform a search after installing this plugin, there will be a cloud of related search terms to help you further refine your search.

Search Everywhere: This plugin adds a button to the bottom of your browser that when you click it, allows you to (among many other features) limit your search to just that site. I find this one particularly helpful as i can usually remember where i read something but did not save the exact url.

Where do I put swc files in Flash CS4?

Jeff March 26th, 2009

I ran across this question the other day and there were links to CS3 but not for CS4. What I did was put it in the following location, after creating a new folder to hold my components for organization. A restart of CS4 will have them show up in your components library.

C:\Documents and Settings\username\Local Settings\Application Data\Adobe\Flash CS4\language\Configuration\Components\NewFolder

A truly open company

Jeff March 5th, 2009

Atlassian just announced that they are going to allow people to contribute to their documentation after going through a short application process. (I submitted mine and was approved within a few hours so it isn’t too intense.) ;)

It is really cool to see a company that is creating such an amazing wiki product allow verified users to update the documentation. Theirs has been really accurate but there have been a few times where it would be nice to add a bit of info and now people will be able to do just that! I am curious to see how this works out.

More information.

Confluence Personal Labels Tip - Bookmark Toolbar

Jeff January 10th, 2009

Using personal labels in Confluence is just one of the many ways you can organize your content. For those of you not familiar with labels, think of them as folders where content can live in multiple folders, without physically being duplicated. Having a quick way to access this list can really speed up the way you use the wiki and make you more efficient. Continue Reading »

Navigation Sidebar on One Wiki Page - Confluence

Jeff December 31st, 2008

I had a wiki user ask me about the navigation side bar in Confluence (we are on 2.8.2) and if it is possible to add this to just the home page instead of the whole space. After a little bit of work, this is what I came up with: Continue Reading »

WebSite Updates!

Jeff December 16th, 2008

I had a laundry list of things I had been wanting to do with my website for a long time and I finally got around to doing it. For starters I upgraded to Wordpress 2.7 to take advantage of all the new features and streamlined dashboard. Here is the rest of what is new: Continue Reading »

New page - Recommended Reading

Jeff December 14th, 2008

I don’t believe that social bookmarking has quite taken off in the mainstream web arena yet. For those of you looking to get into it (or simply wondering how it can be useful), you need to check out Diigo. It is a site that stores your bookmarks but also allows you to do many more things such as write a description/review/summary, highlight parts of the page, and share your notes on the page with friends.  Continue Reading »

Room To Read

Jeff December 3rd, 2008

You should donate to John’s project, providing a library to children in Cambodia, especially during this holiday season. What a great way to change lives in an area that needs it. Read more about John here and the non profit Room to Read.

Continue Reading »

JDeveloper and Firefox

Jeff November 6th, 2008

We ran into a problem at work running JDeveloper (10g12) with Firefox (3) where the css files would not load properly.  The error in the error console of Firefox stated:

Error: The stylesheet http://comp.domain.org:5555/OA_HTML/xxwv2masterstyle-v8.css was not loaded because its MIME type, "application/octet-stream", is not "text/css".
Source File: http://comp.domain.org:5555/OA_HTML/ibeCZzpHome.jsp?intra=t&amp;log=t
Line: 0

To fix this we simply added the following node to the web.xml file in WEB_INF:

<mime-mapping>
<extension>css</extension>
<mime-type>text/css</mime-type>
</mime-mapping>

You may also need to modify a mime-types file but we did not.

Next »