Very Frankly Speaking

better than your blog.

What I like about Javascript frameworks

The thing I like about Javascript frameworks so far is that I don’t seem to be having the same kind of browser compatibility issues I used to have when I used to write most of my Javascript from scratch.  All of the browser incompatibilities have been abstracted to me so I don’t have to worry about whether or not things work in IE6, IE7, Firefox..etc FOR THE MOST PART.

No comments

Firefox 3.0 and the Web Developer Toolbar

Two new quirks with Firefox 3.0 and my Web Developer Toolbar:

1.)  I can’t do CTRL+SHIFT+S to not show the styles on my page.  Instead my bookmarks show up on a sidebar.  Boo.

2.)  I can’t do CTRL+SHIFT+Y to inspect a particular element in the DOM and see where it sits in the DOM.  Instead, this “Jump to Tag” window pops up.
I will now search for a solution.  If anyone finds it before me, please comment.

No comments

Oracle vs. MySQL (my experience)

I didn’t know you had to say “commit;” after any SQL statement in Oracle to have the changes take effect. Maybe I’m stupid but no one ever taught me this, lol.

No comments

Handling jQuery serialize() on the backend with PHP

My goal for this one situation is to validate all my form data with my backend PHP code through AJAX. If all the checks on my form don’t go through successfully, the page will not go to the next page specified in the HTML form’s “action” attribute.

On the Javascript side I use the serialize() function to take all my form data and pass it through to action.php.

$("#submit-form").submit( function(){ var data = $(this).serialize(); $.post( "action.php", { action: "ajax_verify_form", data: data }, function(response){ alert(response); return false; } ); return false; } );

On the PHP side:

if($action == "ajax_verify_form"){ $fields = explode("&",$data); foreach($fields as $field){ $field_key_value = explode("=",$field); $key = urldecode($field_key_value[0]); $value = urldecode($field_key_value[1]); eval("$$key = "$value";"); } }

Now I have all the same variables from the client side on the PHP side. Now you can do whatever form-checking you need with PHP.  If you have an error, echo the error so the callback function on the jquery.post() function will catch it.

3 comments

If I wanted to take the bus home from work…

Google Transit is saying that it will take me 53 minutes to get home if I ride the bus. It will cost me $1.50 to take the bus. It’s less than 10 miles between home and work. My car gets about 34 miles per gallon. Gas was like $3.79. I think it will be cheaper to drive.

Here’s the Google Transit route: http://twurl.nl/genltl

No comments

Using PHP’s putenv() function to set environment variables and connecting to an Oracle database

Yay, my first real technical blog post!

I’ve been trying to tackle this issue for a while. I’ve been making a connection to an Oracle database using PHP, but I’d have to modify the environment variables to tell PHP where to find the Oracle installation and the tnsnames.ora file. To do this, I would use the putenv() PHP function to set the ORACLE_HOME and TNS_ADMIN variables. The problem was that it was being really really erratic. It would make a connection one day and the next day it’s not working. Did the freaking server admin make changes to the server? Am I pointing the environment variables to the right place? Trust me, I went over this issue for a long time.

Well the issue is that you’re not even supposed to be usnig putenv() to set environment variables. In fact it’s going to be deprecated by PHP ver. 6.0… Thanks to this PDF http://www.oracle.com/technology/tech/php/pdf/underground-php-oracle-manual.pdf on page 100 it states that you’re supposed to be setting the environment variables in the shell that starts Apache. I’ve sent the request in to my server admin (since i don’t have rights) and I’m pretty confident that this will work.

[UPDATE]

Setting the environment variables on Apache worked…  for the most part.  It still craps out maybe like 10% of the time.  This is still an issue which still needs some investigation.

2 comments

What to write about…

I think I might start using this webspace as a place to document all my web-development related issues. I can only share so much of work related stuff since that stuff is confidential, but I think I can keep it general enough.

No comments

Goodphil Wallpaper

http://www.frankmaulit.com/IMG_2240.jpg

No comments

Mexico