<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>scriptygoddess &#187; Lessons learned</title>
	<atom:link href="http://www.scriptygoddess.com/archives/category/lessons-learned/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scriptygoddess.com</link>
	<description></description>
	<lastBuildDate>Tue, 24 Aug 2010 13:58:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Test Credit Card Numbers</title>
		<link>http://www.scriptygoddess.com/archives/2010/05/29/test-credit-card-numbers/</link>
		<comments>http://www.scriptygoddess.com/archives/2010/05/29/test-credit-card-numbers/#comments</comments>
		<pubDate>Sun, 30 May 2010 03:09:33 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[Lessons learned]]></category>
		<category><![CDATA[shopping cart]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/?p=1639</guid>
		<description><![CDATA[When you are working with an online store, sometimes you need to enter a credit card number that will pass the &#034;logic&#034; of how the card number should be structured so that you can test the flow of your site. These card numbers are not valid for purchase, and if validated against a gateway &#8211; [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>When you are working with an online store, sometimes you need to enter a credit card number that will pass the &#034;logic&#034; of how the card number should be structured so that you can test the flow of your site. These card numbers are not valid for purchase, and if validated against a gateway &#8211; it will return as being invalid &#8211; however, that&#039;s fine if all you&#039;re testing is the front end process of the store (before the gateway). In cleaning out my office today, I found a few numbers I used to use for this purpose. I can&#039;t remember if all of them worked (and the next time I have to run a test, I&#039;ll remove any I use that seem not to) &#8211; but wanted to keep these safer than in the dark corners of my office closet&#8230; </p>
<p>Visa:<br />
4444 3333 2222 1111</p>
<p>MasterCard:<br />
5424 0000000000 15<br />
(there&#039;s 10 zero&#039;s in there)</p>
<p>Discover:<br />
6011 0000000000 12<br />
(Again, 10 zero&#039;s)</p>
<p>Amex:<br />
37 000000000000 2<br />
(12 zero&#039;s in there)</p>
<p>There&#039;s also a bunch of other <a href="http://www.paypal.com/en_US/vhelp/paypalmanager_help/credit_card_numbers.htm">test credit card numbers here</a> in case you need them.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2010/05/29/test-credit-card-numbers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS for iPhone&#039;s eyes only (watch out for the cache)</title>
		<link>http://www.scriptygoddess.com/archives/2010/04/14/css-for-iphones-eyes-only-watch-out-for-the-cache/</link>
		<comments>http://www.scriptygoddess.com/archives/2010/04/14/css-for-iphones-eyes-only-watch-out-for-the-cache/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 04:21:07 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS related]]></category>
		<category><![CDATA[Lessons learned]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/?p=1636</guid>
		<description><![CDATA[On a project I was working on recently, I was pulling in some css for iPhone users using PHP with the following code: &#60;php if (strpos($_SERVER['HTTP_USER_AGENT'],"iPhone")) { ?&#62; ... CUSTOM CSS FOR IPHONE... &#60;php } ?&#62; This will also work for iPhones and iPod Touch: &#60;php if (strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') &#124;&#124; strstr($_SERVER['HTTP_USER_AGENT'],'iPod')) { ?&#62; ... CUSTOM CSS... [...]


Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2010/03/16/seo-plugins-and-problems-with-the-titles-not-rewriting-wordpress/' rel='bookmark' title='Permanent Link: SEO Plugins and problems with the titles not rewriting (WordPress)'>SEO Plugins and problems with the titles not rewriting (WordPress)</a> <small>I can&#039;t speak for anyone else who has run into...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/10/anchor-links-in-wordpress-posts-another-shortcode-solution/' rel='bookmark' title='Permanent Link: Anchor Links in WordPress Posts &#8211; another shortcode solution'>Anchor Links in WordPress Posts &#8211; another shortcode solution</a> <small>I was recently asked by a client how they could...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>On a project I was working on recently, I was pulling in some css for iPhone users using PHP with the following code:</p>
<p><code>&lt;php if (strpos($_SERVER['HTTP_USER_AGENT'],"iPhone")) { ?&gt;<br />
... CUSTOM CSS FOR IPHONE...<br />
&lt;php } ?&gt;</code></p>
<p>This will also work for iPhones and iPod Touch:</p>
<p><code>&lt;php if (strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'],'iPod')) { ?&gt;<br />
... CUSTOM CSS...<br />
&lt;php } ?&gt;</code></p>
<p>That&#039;s great and all &#8211; but then suddenly one day it stopped working. Going back through what changed on the site, I realized one thing we added was a cache plugin. DOH! So the page gets cached without the custom CSS for the iPhone &#8211; the iPhone calls up the site but gets served the cached page (non-iPhone version)&#8230; Yeah, that would do it.</p>
<p>So I found <a href="http://www.boutell.com/newfaq/creating/iphone.html">this solution</a>:</p>
<p><code>&lt;!--[if !IE]&gt;--&gt;<br />
    &lt;style type="text/css"&gt;<br />
	@media only screen and (max-device-width: 480px) {<br />
.... CUSTOM CSS HERE....<br />
	}<br />
	&lt;/style&gt;<br />
&lt;!--&lt;![endif]--&gt;</code></p>
<p>or of course you can pull in a whole stylesheet for the iphone:</p>
<p><code>&lt;!--[if !IE]&gt;--&gt;<br />
&lt;link media="only screen and (max-device-width: 480px)"  rel="stylesheet" type="text/css" href="iphone.css" /&gt;<br />
&lt;!--&lt;![endif]--&gt;</code></p>


<p>Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2010/03/16/seo-plugins-and-problems-with-the-titles-not-rewriting-wordpress/' rel='bookmark' title='Permanent Link: SEO Plugins and problems with the titles not rewriting (WordPress)'>SEO Plugins and problems with the titles not rewriting (WordPress)</a> <small>I can&#039;t speak for anyone else who has run into...</small></li>
<li><a href='http://www.scriptygoddess.com/archives/2009/09/10/anchor-links-in-wordpress-posts-another-shortcode-solution/' rel='bookmark' title='Permanent Link: Anchor Links in WordPress Posts &#8211; another shortcode solution'>Anchor Links in WordPress Posts &#8211; another shortcode solution</a> <small>I was recently asked by a client how they could...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2010/04/14/css-for-iphones-eyes-only-watch-out-for-the-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>swfobject &#8211; flash doesn&#039;t load in Firefox</title>
		<link>http://www.scriptygoddess.com/archives/2009/12/16/swfobject-flash-doesnt-load-in-firefox/</link>
		<comments>http://www.scriptygoddess.com/archives/2009/12/16/swfobject-flash-doesnt-load-in-firefox/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 18:17:43 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Lessons learned]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/?p=1627</guid>
		<description><![CDATA[Ran into a bizarre problem today using swfobject. A lot of wasted time, but I&#039;ll give you the short story / solution. I&#039;m not sure of what other factors played a role (the fact that the element was in a absolute positioned container, or that the immediate container to the flash element was in a [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Ran into a bizarre problem today using <a href="http://code.google.com/p/swfobject/">swfobject</a>. A lot of wasted time, but I&#039;ll give you the short story / solution.</p>
<p>I&#039;m not sure of what other factors played a role (the fact that the element was in a absolute positioned container, or that the immediate container to the flash element was in a float) but I had the call to the swfobject javascript in the BODY tags of the html (not within the head tags). This was apparently causing Firefox to not display the flash. Simply moving the swfobject javascript code within the head tags of the html instantly fixed the problem.</p>
<p>I know I&#039;ve used swfobject inside the body before &#8211; so I&#039;m sure there&#039;s something else that contributed to the problem.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2009/12/16/swfobject-flash-doesnt-load-in-firefox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Image as buttons (and IE issues)</title>
		<link>http://www.scriptygoddess.com/archives/2005/03/07/image-as-buttons-and-ie-issues/</link>
		<comments>http://www.scriptygoddess.com/archives/2005/03/07/image-as-buttons-and-ie-issues/#comments</comments>
		<pubDate>Mon, 07 Mar 2005 21:28:36 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[Lessons learned]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2005/03/07/image-as-buttons-and-ie-issues/</guid>
		<description><![CDATA[Oh, this one was going to drive me NUTS! I had to use images as buttons in a form. That&#039;s easy enough: &#60;input type="image" SRC="blahButton.gif" ALT="blah" name="blah" id="blah" value="blah" /&#62; Which works fine when simply submitting the form when there&#039;s ONE button. But on one page I had TWO buttons. The form would submit to [...]


Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/10/27/striping-img-tags-from-the_content-in-wordpress-and-how-to-fudge-page-excerpts/' rel='bookmark' title='Permanent Link: Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)'>Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)</a> <small>Background: For a site I was working on, I was...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Oh, this one was going to drive me NUTS! I had to use images as buttons in a form. That&#039;s easy enough:</p>
<p><code>&lt;input type="image" SRC="blahButton.gif" ALT="blah" name="blah" id="blah" value="blah" /&gt;</code></p>
<p>Which works fine when simply submitting the form when there&#039;s ONE button. But on one page I had TWO buttons. The form would submit to itself, and then depending on which button was clicked, I would handle the form as appropriate. Worked fine in firefox &#8211; nothing happened in IE. I found <a href="http://www.webmasterworld.com/forum21/9694.htm">this page in a search</a>.</p>
<p>What I had been doing was simply (in php)</p>
<p><code>if (isset($_POST["blah"])) {<br />
	//do stuff<br />
} else if (isset($_POST["blahblah"])) {<br />
	//do different stuff<br />
}</code></p>
<p>What fixed the problem was changing that code to this:</p>
<p><code>if (isset($_POST["blah_x"])) {<br />
	//do stuff<br />
} else if (isset($_POST["blahblah_x"])) {<br />
	//do different stuff<br />
}</code></p>
<p>Now my form works&#8230;</p>


<p>Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/10/27/striping-img-tags-from-the_content-in-wordpress-and-how-to-fudge-page-excerpts/' rel='bookmark' title='Permanent Link: Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)'>Striping IMG tags from the_content in WordPress (and how to fudge page excerpts)</a> <small>Background: For a site I was working on, I was...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2005/03/07/image-as-buttons-and-ie-issues/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>ASP: Look up / translation script</title>
		<link>http://www.scriptygoddess.com/archives/2004/11/10/asp-look-up-translation-script/</link>
		<comments>http://www.scriptygoddess.com/archives/2004/11/10/asp-look-up-translation-script/#comments</comments>
		<pubDate>Wed, 10 Nov 2004 14:47:15 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[Bookmarks]]></category>
		<category><![CDATA[Lessons learned]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2004/11/10/asp-look-up-translation-script/</guid>
		<description><![CDATA[I should create a category called &#034;saved my ass&#034;! This script would fall under it. I was asked to create a &#034;look up&#034; tool that would sort of &#034;translate&#034; one piece of text to another. The user would enter in the first piece of text, and then they&#039;d be given the &#034;value&#034;. Oh, and this [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I should create a category called &#034;saved my ass&#034;! This script would fall under it.</p>
<p>I was asked to create a &#034;look up&#034; tool that would sort of &#034;translate&#034; one piece of text to another. The user would enter in the first piece of text, and then they&#039;d be given the &#034;value&#034;. Oh, and this list updates every few months or so.</p>
<p>At first I started looking into creating a database, and writing a script that would update that database &#8211; problem was that creating and accessing a database for this project was going to be time consuming and difficult. A server-side script would have been the best solution under the circumstances. A few hours this morning searching around turned up <a href="http://www.asptutorial.info/learn/Dictionary.asp">this &#034;dictionary&#034; script</a>.</p>
<p>I&#039;m actually being given the the text and values in excel, so I just need to create a sort of &#034;template&#034; in excel that formats everything so it will look like the code &#8211; and then I just copy and paste it all into the ASP file.</p>
<p>So here&#039;s kind of what I have in my file:<br />
<h3>SET TextToNumber=CreateObject(&#034;Scripting.Dictionary&#034;)<br />
TextToNumber.Add &#034;name&#034;, &#034;292949&#034;<br />
TextToNumber.Add &#034;date&#034;, &#034;123414&#034;<br />
etc. etc&#8230;</h3>
<p>Then my form looks like this:</p>
<h3>&lt;form name=&#034;textlookup&#034; action=&#034;lookup.asp&#034; method=&#034;post&#034;&gt;<br />
Text: &lt;input type=&#034;text&#034; name=&#034;text&#034; value=&#034;" /&gt;&lt;br&gt;<br />
&lt;input type=&#034;submit&#034; name=&#034;submit&#034; value=&#034;Look Up Text Number&#034; /&gt;&lt;/form&gt;<br />
Text: &lt;% Response.Write(Request.Form(&#034;text&#034;)) %&gt;&lt;br&gt;<br />
Number: &lt;%<br />
TextValue=Request.Form(&#034;text&#034;)<br />
NumberValue=TextToNumber(TextValue)<br />
Response.Write(NumberValue)<br />
%&gt;</h3>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2004/11/10/asp-look-up-translation-script/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>PHP: simple logic statement</title>
		<link>http://www.scriptygoddess.com/archives/2004/11/05/php-simple-logic-statement/</link>
		<comments>http://www.scriptygoddess.com/archives/2004/11/05/php-simple-logic-statement/#comments</comments>
		<pubDate>Sat, 06 Nov 2004 01:47:38 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[Lessons learned]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2004/11/05/php-simple-logic-statement/</guid>
		<description><![CDATA[I&#039;m tired of searching for the correct syntax everytime I wan to use this line&#8230; if you&#039;re doing a simple one line &#034;if&#034; statement, you can use a &#034;ternary conditional operator&#034; &#8211; for example: echo $variable == &#039;value&#039; ? &#039;print if true&#039; : &#039;print if false&#039;; Related posts:Conditionally change path to HTTPS One of my [...]


Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/10/06/conditionally-change-path-to-https/' rel='bookmark' title='Permanent Link: Conditionally change path to HTTPS'>Conditionally change path to HTTPS</a> <small>One of my clients had set it up so that...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I&#039;m tired of searching for the correct syntax everytime I wan to use this line&#8230; if you&#039;re doing a simple one line &#034;if&#034; statement, you can use a &#034;ternary conditional operator&#034; &#8211; for example:<br />
<h3>echo $variable == &#039;value&#039; ? &#039;print if true&#039; : &#039;print if false&#039;;</h3>


<p>Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/10/06/conditionally-change-path-to-https/' rel='bookmark' title='Permanent Link: Conditionally change path to HTTPS'>Conditionally change path to HTTPS</a> <small>One of my clients had set it up so that...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2004/11/05/php-simple-logic-statement/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Continue vs. Break (in while loops)</title>
		<link>http://www.scriptygoddess.com/archives/2004/10/25/continue-vs-break-in-while-loops/</link>
		<comments>http://www.scriptygoddess.com/archives/2004/10/25/continue-vs-break-in-while-loops/#comments</comments>
		<pubDate>Mon, 25 Oct 2004 17:15:13 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[Lessons learned]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2004/10/25/continue-vs-break-in-while-loops/</guid>
		<description><![CDATA[(note to self type post) Using &#034;continue&#034; in the middle of a while loop will skip the current iteration and go back to the beginning of the loop (checking the while value again). Using &#034;break&#034; in the middle of a while loop will break the loop entirely. (no more looping) So this code &#60;?php $i [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>(note to self type post)<br />
Using &#034;continue&#034; in the middle of a while loop will skip the current iteration and go back to the beginning of the loop (checking the while value again).</p>
<p>Using &#034;break&#034; in the middle of a while loop will break the loop entirely. (no more looping)</p>
<p>So this code<br />
<h3>&lt;?php<br />
$i = 0;<br />
while ($i &lt; 5) {<br />
$i++;<br />
	if ($i%2) {<br />
		echo &#034;value = &#034; .$i . &#034; &#8211; inside if&lt;br&gt;&#034;;<br />
		<strong>continue;</strong><br />
	}<br />
echo &#034;value = &#034; .$i . &#034; &#8211; outside if&lt;br&gt;&#034;;<br />
}<br />
?&gt;</h3>
<p>Will produce this:<br />
value = 1 &#8211; inside if<br />
value = 2 &#8211; outside if<br />
value = 3 &#8211; inside if<br />
value = 4 &#8211; outside if<br />
value = 5 &#8211; inside if</p>
<p>Where as this</p>
<h3>&lt;?php<br />
$i = 0;<br />
while ($i &lt; 5) {<br />
$i++;<br />
	if ($i%2) {<br />
		echo &#034;value = &#034; .$i . &#034; &#8211; inside if&lt;br&gt;&#034;;<br />
		<strong>break;</strong><br />
	}<br />
echo &#034;value = &#034; .$i . &#034; &#8211; outside if&lt;br&gt;&#034;;<br />
}<br />
?&gt;</h3>
<p>Will produce this:<br />
value = 1 &#8211; inside if</p>
<p><a href="http://us2.php.net/while">See more about while loops here.</a></p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2004/10/25/continue-vs-break-in-while-loops/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Button Element</title>
		<link>http://www.scriptygoddess.com/archives/2004/10/25/button-element/</link>
		<comments>http://www.scriptygoddess.com/archives/2004/10/25/button-element/#comments</comments>
		<pubDate>Mon, 25 Oct 2004 13:19:35 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[Bookmarks]]></category>
		<category><![CDATA[Lessons learned]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2004/10/25/button-element/</guid>
		<description><![CDATA[Hello, I&#039;d like to take HTML 101. So I was working on a form. Used this method to create the form. Minimal HTML. Simple CSS. Started playing around with the :focus pseudo-class&#8230; and that&#039;s when I noticed my submit button started looking crummy. (From a usability perspective, I think there are some things that SHOULDN&#039;T [...]


Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/12/16/swfobject-flash-doesnt-load-in-firefox/' rel='bookmark' title='Permanent Link: swfobject &#8211; flash doesn&#039;t load in Firefox'>swfobject &#8211; flash doesn&#039;t load in Firefox</a> <small>Ran into a bizarre problem today using swfobject. A lot...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Hello, I&#039;d like to take HTML 101.</p>
<p>So I was working on a form. <a href="http://www.quirksmode.org/index.html?/css/forms.html">Used this method to create the form</a>. Minimal HTML. Simple CSS. Started playing around with the :focus pseudo-class&#8230; and that&#039;s when I noticed my submit button started looking crummy. (From a usability perspective, I think there are some things that SHOULDN&#039;T be over-styled. Scrollbars, Buttons. People are used to seeing these have the default look of their OS or Browser. Mess with them, and while you may think YOUR design of them looks pretty, they&#039;re probably not as usable anymore.)</p>
<p>So I went searching for a way to revert an element back to it&#039;s default, and basically discovered that it&#039;s not possible. But the search led me to <a href="http://www.ozoneasylum.com/22895">this page</a> where the suggestion was to simply use the &lt;button&gt;&lt;/button&gt; tag instead of &lt;input type=&#034;button&#034; /&gt; <a href="http://www.w3.org/TR/html401/interact/forms.html#h-17.5">W3C says you can even</a> (however, the validate local html through the web developer extension in Firefox is giving me errors on all the attributes, even though they are within spec of the DTD.)</p>
<p>Button element?? Ok, add that to the list of things I probably should have known about but didn&#039;t! :-/</p>


<p>Related posts:<ol><li><a href='http://www.scriptygoddess.com/archives/2009/12/16/swfobject-flash-doesnt-load-in-firefox/' rel='bookmark' title='Permanent Link: swfobject &#8211; flash doesn&#039;t load in Firefox'>swfobject &#8211; flash doesn&#039;t load in Firefox</a> <small>Ran into a bizarre problem today using swfobject. A lot...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2004/10/25/button-element/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>gifs that execute a php script</title>
		<link>http://www.scriptygoddess.com/archives/2004/10/19/gifs-that-execute-a-php-script/</link>
		<comments>http://www.scriptygoddess.com/archives/2004/10/19/gifs-that-execute-a-php-script/#comments</comments>
		<pubDate>Tue, 19 Oct 2004 16:37:59 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[Lessons learned]]></category>
		<category><![CDATA[Script snippet]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2004/10/19/gifs-that-execute-a-php-script/</guid>
		<description><![CDATA[Problem: (somewhat in line with my last post) I needed to run a script in the &#034;background&#034;, but I only had the ability to present the script as a .gif. Solution: actually, I came up with two ways of doing this and both use .htaccess to pull it off. 1) I&#039;m a gif but really [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Problem: (somewhat in line with my last post) I needed to run a script in the &#034;background&#034;, but I only had the ability to present the script as a .gif.</p>
<p>Solution: actually, I came up with two ways of doing this and both use .htaccess to pull it off.</p>
<p><strong>1) I&#039;m a gif but really I&#039;m a php script</strong><br />
This one is fairly straightfoward. I put my script in a seperate directory, (that doesn&#039;t actually include any images!) and renamed it from filename<strong>.php</strong> to filename<strong>.gif</strong> (or filename<strong>.jpg</strong>) (Yes, I know it&#039;s not really an image file. Hang in there)</p>
<p>Then, in the htaccess file for JUST THAT FOLDER! (similar to <a href="http://www.scriptygoddess.com/archives/2003/04/02/running-php-on-a-html-or-htm-page/">this trick</a>) I added this:<br />
<code>AddType application/x-httpd-php .php .jpg .gif</code></p>
<p>FYI &#8211; in your php file (that now looks like a .gif or .jpg) make sure you don&#039;t have any headers/text echoed, and at the end of the file add this to your php code:<br />
<code>header('Content-Type: image/gif');<br />
@readfile( '/SERVERPATH/TO/A/REAL/IMAGE/spacer.gif' );</code></p>
<p>You can then include the &#034;script&#034; as if it were an image file, it will run the script, but only display a gif to the user.</p>
<p>You can even pass it variables like filename.gif?somevariable=somevalue&#038;anotervariable=anothervalue, but there&#039;s another way to do that too without the ugly URL.</p>
<p><strong>2) I&#039;m a gif that&#039;s actually a php script super-powered with rewrite</strong><br />
Ok, starting from the beginning. You have your script (filename.php) in a folder, add the following to the .htaccess file in that folder:<br />
<code>RewriteEngine On<br />
RewriteBase /<br />
RewriteRule ^(.*)/(.*)/spacer.gif /YOURFOLDER/FILENAME.php?somevar=$1&#038;anothervar=$2 [QSA]</code></p>
<p>Before we continue, I must tell you that I dont&#039; completely understand rewrite rules. There&#039;s a LOT of holes in my knowledge. So if you have a better way, PLEASE post it in the comments. I would LOVE to be able to understand what the hell I&#039;m doing. LOL.</p>
<p>OK, moving along. Now you can call your script by actually calling that &#034;phantom&#034; spacer.gif, with the variables in the URL as if they&#039;re directories like this:</p>
<p><code>http://www.yourdomain.com/YOURFOLDER/somevalue/anothervalue/spacer.gif</code></p>
<p>Again, make sure you have this at the end of you php code in your filename.php:<br />
<code>header('Content-Type: image/gif');<br />
@readfile( '/SERVERPATH/TO/A/REAL/IMAGE/spacer.gif' );</code></p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2004/10/19/gifs-that-execute-a-php-script/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Border tricks and centering issues</title>
		<link>http://www.scriptygoddess.com/archives/2004/10/09/border-tricks-and-centering-issues/</link>
		<comments>http://www.scriptygoddess.com/archives/2004/10/09/border-tricks-and-centering-issues/#comments</comments>
		<pubDate>Sat, 09 Oct 2004 23:32:50 +0000</pubDate>
		<dc:creator>Jennifer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Lessons learned]]></category>

		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2004/10/09/border-tricks-and-centering-issues/</guid>
		<description><![CDATA[I&#039;m working on redesigning a site in CSS that I did many eons ago using tables for Christine. While I&#039;m getting the hang of CSS, I still have a long ways to go. First of all &#8211; Christine wants a border around her photos: first a thick white one, then a one pixel black one. [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I&#039;m working on redesigning a site in CSS that I did many eons ago using tables for <a href="http://www.bigpinkcookie.com">Christine</a>. While I&#039;m getting the hang of CSS, I still have a long ways to go.</p>
<p>First of all &#8211; Christine wants a border around her photos: first a thick white one, then a one pixel black one. She had previously been doing that with photoshop, but I&#039;ve suggested to her that it would be better to just do it in CSS&#8230; On my first try, I had tried wrapping the img tag in a number of divs &#8211; which not only didn&#039;t really work quite right, it added extra html that didn&#039;t need to be there. The answer was simple. Here is the CSS I used for the border (a class I add to the img tag) :<br />
<h3>padding: 15px;<br />
border: 1px solid #000;<br />
background-color: #fff;</h3>
<p>The other thing I was struggling with was another (should have been) simple issue. I simply wanted a block of text, 600px wide &#8211; centered on the page, but with the text flush left. The key I was missing was adding <strong>margin-right:auto;</strong> and <strong>margin-left:auto;</strong>. So here&#039;s the CSS for the outer div &#8211; and the div for the text block:</p>
<h3>#content {<br />
text-align: center;<br />
}<br />
#text{<br />
width: 600px;<br />
margin-right:auto;<br />
margin-left:auto;<br />
text-align:left;<br />
}</h3>
<p>The only way I was able to figure that out was from looking at the examples on <a href="http://www.maxdesign.com.au/presentation/page_layouts/index.cfm">Max Design: CSS Page Layouts</a></p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptygoddess.com/archives/2004/10/09/border-tricks-and-centering-issues/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.679 seconds -->
