PHP scripts and games

So I’ve been adding a few RPGs and other games to the site and have had to edit those scripts quite a lot more than I should have to to get them to work on my site. Don’t get me wrong (especially if you happen to be a creator of one of those scripts), I love the games, and they have MANY good features in them, but it amazes me how much people code to their own setup. One example (and the most annoying because it breaks the script immediately), is the use of PHP short tags ( <? ). These little things are the bane of my existance.

There are four ways that you can let the server know that you are about to use PHP.

  • PHP Long tags ( <?php ...code... ?> )
  • PHP Short tags ( <? ...code... ?> )
  • ASP style tags ( <% ...code... %> )
  • Script tags ( <script language="text/php"> ...code... </script> )

Lucky for me, I’ve never seen the ASP tags, and have only rarely seen the Script tag, but the short tags are almost as popular as the long tags. Especially when using the shorthand notation for the echo command ( <?= ).

My server at home is set up to be very strict in it’s handling of tags, it only allows the PHP long tags, and for good reason. When using a PHP script with XML, the XML tag ( <?xml ) confuses the PHP parser into thinking it’s a PHP short tag with the unknown entity ‘xml’ following it.

Another thing I see people use often, is Registered Globals. These are extremely handy at saving yourself some keystrokes, but that’s about the only thing they are good for. Registered Globals take variables from a SuperGlobal and place it in the normal variable scope. An example would be an HTML form with a field called ‘name’.  When you send this form, a variable in PHP called either _POST or _GET is created based on which method is used to send the data. To get at the data the user sent, one must call $_POST['name'].  If Registered Globals is turned on, all one needs to do is call the variable $name and there ya go. This practice is not very safe and causes more headaches then they save in keystrokes.

All of these issues, plus some more obscure ones, are why people should not code to their own particular setup, but should code with certain standards that are applicable everywhere.

  • PHP Long tags are ALWAYS accepted by the server.
  • The _POST and _GET variables are ALWAYS available to the script.
  • The HTTP_XXXXX_VARS are NOT always available, as of PHP5 they can be disabled.
  • Even the _ENV and _SERVER vars are not always enabled.

So when you go out to write your first bit of code, or even continue work on a project you’ve been working on for years, think of the other people who may be using your script who may not have the same setup as you, and they may not have access to their php.ini file to change those settings. And don’t try to skirt your way around it by running the ini_set function either. That’s almost like putting a virus on someone else’s computer. Just don’t do it.

broken site

so my webhosting company was recently bought out and decided in all thier wisdom to follow the old adage of “if it’s not broke, break it, then don’t fix it”.  ok, maybe it’s not an old adage, but it sure does fit the situation.

the new company decided to move all the websites to new servers and in the process broke just about every one of the thousands of sites hosted on those servers, mine included. and it doesn’t stop there. in the past couple of weeks, my site has been off and on more than a newbie dj mixing with cassette tapes.

it seems like every couple of hours the site goes down, only to be back up again (but with limited functionality) the next time i see it. it’s getting really annoying. and the support people are not really helping, but it’s not entirely thier fault, because it seems that the errors are not happening everywhere in the country.
anywho…  the whole point of the post is to let everybody know why the site has been being stupid lately.

…and don’t host your site with WebHostPlus.

new job and web standards

so i got a new job working for a local independent graphic designer / printer and its pretty nice. i get to work when i want, at my own pace, from home, doing what i love, and get paid for it. the only thing about it that really sucks is that i’m doing web design and as any semi-serious web designer that works for clients will tell you, coding for cross-browser compatibility SUCKS !!

i mean, why can’t all the browsers stop the damn browser wars and come to an agreement on what will and will not be supported?  it seems that the w3c has been doing a good job with stating what should be standard and what should not be standard, and most browsers do a pretty god job following those standards.

except one. microsoft’s internet explorer, the number one used browser on the planet. it works the way it wants to work, and getting your site to look the way you want it to in internet explorer is like trying to teach a four year old how to fly a plane. they may get some things right, but most of the time, they budge things up so bad, you have no idea what they are trying to do. and then all of a sudden, they don’t want to do anything anymore. it is the most annoying thing on the planet, because fixing one thing breaks another and when you get it all looking good in internet explorer and then go back and open up the same page in firefox (my personal favorite and most likely the favorite browser of any self-respecting web designer / aficionado) it looks totally whacked and nothing is where it is supposed to be.

and that’s not even considering the dinosaurs out there, who just absolutely have to have thier netscape communicator 4.75, which has almost no current standards support and what it does support (obsolete and completely annoying things like ‘blink’) it supports badly or is no longer a web standard.

but that’s okay, i figure anybody using web browsers older than the wheel are probably used to things looking all messed up, or they are too computer illiterate to care.

i eagerly await the release of internet explorer 7 (which has taken several years, because microsoft, in all thier wisdom, thought, “we have the monopoly on web browsers, why fuck with it?”. that is, until firefox started taking thier precious users and microsoft just HAS to have the monopoly) because that will mean (hopefully) that interent explorer will finally have decent web standards and png support and i won’t have to keep writing several versions of the same page just to get it to look right everywhere. (but hopefully it will still be subject to the same css hacks, so in case it does mess something up, i wont have to rewrite everything to fix it.)

now all we need is to kill off the dinosaurs and we’ll be all set.

the meaning of life

well, i think it’s inevitable. if you have a blog, or any kind of diary, you have to write about the meaning of life.

so here is my meaning of life, and if it gets too philosophical for you, stop reading, i don’t care…   or do i?

anywho…  me and my girl were driving home one day, talking about our childhoods, and it got me thinking about my life as a whole.

now i’m not just talking about the little stuff, or just the big stuff, i mean the whole thing, every bit of it. i had never thought about my life like that and it got me thinking… what makes a life, or better yet, what makes a life good?

everybody is so determined to make a difference in the world, to be somebody. i don’t think this is what life is about, because, let’s be honest, how many of us are really going to make a difference outside of our own little bubbles?

but that’s just the point, you don’t have to make a difference outside your own little bubble. you don’t even have to make a difference inside your own little bubble. the key to true happiness — and this is just a theory, but it seems to be a good one — is to live your life. don’t try to make a difference, don’t live the life others want you to live, just live… do what makes you happy. and along the way, and this is important, so pay attention…  along the way, let others make a difference in you.

if somebody comes along and changes you, not a lot, just enough that you are a slightly new person (but some may change you completely…  mly), then you have increased the value of that persons life, and letting others know that they are the cause of your happiness makes them happy, and in turn makes you happy.

so not so long story short, and so i can steal another quote: don’t try to be a great man, just be a man, the rest will take care of itself. and if you have a little fun on the way, all the better. because life isn’t here for you to change it, or take it for granted, it’s here for you to enjoy.   and if along the way you are remembered by those who touched you… even better.

just a thought i had to share.
please comment and share your own thoughts.

rss feeds update

since writing ‘rss feeds in your inbox‘, the post letting people know how to get my blog in their inbox, i have upgraded the blogging software.
this has changed the rss feed url.  the new rss feed url is:

http://www.iohelix.com/wordpress/?feed=rss2
http://www.iohelix.net/blog/feed

so there ya go, all fixed.

anonymity is hard to keep

so i’m sitting here, at work, playing on the interent, and come across a page that has really cool stuff to download for “free”.  and because there is no such thing as “free”, they make you register for their site (for what reason, i have no idea) and give out your precious information, just to download this “free” app that they are offering.

well, i say poo to that. and apparently, others have, too.

that’s when i stumbled upon a couple of sites that help people keep thier anonymity while browsing sites that require a login or registration.

the first is bugmenot.com.  this site is awesome. when you come accross a site that requires you to log in, go to bugmenot.com and enter the base url into the field and click ‘Show Logins’ and it will give you a list of logins for the site. that way, you never have to register for another site again.

but if you really must register for a site and it’s one of the sites that will be sending you a confirmation e-mail so that they know it’s really you, just use pookmail.commintemail.com.
what this site does is pretty cool as well. when you go to sign up for that annoying site that is forcing you to register, just go to mintemail.com, it will automatically store a fresh email address in your clipboard, then enter that email address into the site you are visiting. the mail will be automatically updated and kept for 24 hours, then deleted. you never have to give out your address again, but you still get those important first few emails to the site you’re trying to access.

and for the sites where you may want to come back and be recognized as yourself, but don’t want to use that same password you’ve been using forever, check out the Secure Password Generator or Strong Password Generator.  just set your specs and hit the button and a crytographically strong password is generated at random for you.

so there ya go, no more worries.

honeymoon

so we returned from hawai’i, much more tan than when we left and much more married as well. we had so much fun in hawai’i, it was insane.

i will maybe post a diary that chels kept on our trip later, but just wanted to put a quick post up while i was thinking about it.

if you are ever in the position where you are debating wether or not to go to hawai’i…  GO!!  it’s awesome.

the one thing about hawai’i that i really like is aloha.

if you read my blog religiously, and i know you do, then you know i’m all about the plur.
plur is an acronym that stands for peace, love, unity, respect.

aloha is a much more emotional version of plur.  it, too, is an acronym (from what i’m told, although i’m not sure if the acronym was made to fit the word, since ancient hawai’ians had no written language), although it’s in hawai’ian.

aloha (from a sign in the honolulu airport):

A stood for the word aloha meaning welcome, what i have you may have, share with me.
L stood for the hawai’ian word loko maika’i which meant, what i have said comes from my heart, good intentions.
O stood for the hawai’ian word ‘olu’olu meaning happy. this is part of our heritage – a happy hawai’ian people – happy doing for others.
H stood for the hawai’ian word ha’aha’a meaning humility and meekness. we welcome you, we do things for you, because we are happy and very humble to serve.
A stood for the hawai’ian word a’a ka maka which meant, our eyes are wide open but our lips are sealed. if you have taken all from us, who are we to say, for we knew what we were doing.

thats just cool.

so plur and aloha

marriage

man, it’s so crazy how the little things are what kill you.

everybody always talks about how wonderful thier wedding was, or how wonderful yours is going to be when you have it, but nobody tells you what a nightmare it is planning it. and it’s not the major things, either. it’s the little things: the seating arrangement; the decorations on the table; the gifts to the groomsmen, parents, brides maids, and anybody else; the way your hair is done, and i’m a guy; and everything else that i have forgotten, and won’t remember until it’s too late.

everybody also always asks me if i’m getting nervous…  nervous?  who has time to be nervous, i have to crop pictures for the seating arrangement cards, print them, buy the wine, get my hair done, pick up the engravings, get the rings, clean the hot tub, build a deck, bolt down the canopies, give my two cents on the decorations, help with the dinnerware, buy some serving platters, build a playlist, figure out where the speakers are going, edit the song for ‘the walk’, burn the cd, buy some speaker wire for the deck speakers, mow the lawn, make the rehearsal dinner, and on and on and on.

holy crap.

ask me how it was when i get back…

i’ll tell you it was wonderful, wink, and leave it at that.

computers… blegh

i have been so frustrated by my computer at work lately that i about threw it out the window. i came into work a couple of weeks ago and my computer would not boot, it just kept restarting. so i booted into safe mode, but it never finished, just booted up to one point and stopped. i asked my it boss what was going on and she gave me some pointers which i tried with no success, and finally reinstalled windows, but now the computer won’t recognize the hard drives.

there were two rather large drives in a raid span and only one of them can be recognized at a time. sucky.

so i’m running this data recovery software and hoping that not all is lost, but i fear that it is, and if it is, then i’ll have to rebuild the computer and all my lost data from scratch and that will take me at least a week of solid working. not to mention all the little things that you always use but never think about…  i’ll have to find those, too.

stupid computers, but at least my computer at home is being wierd, too