Archive for October, 2008

Fixing Dell XPS 410 Front Panel Error Codes 3 & 4

Sunday, October 12th, 2008

Does your Dell XPS 410 just sit there with a solid green 3 & 4 and refuse to boot up? Mine does!
Have you tried the suggested Dell method of removing RAM to find the bad stick? I Have!
Does your computer, even with no RAM in it still indicate that same error code? Mine does!

Well good! For a limited time only, I have the solution to your problem! That’s right, turn that paper weight into a super great! (Huh?)

Unplug it. Wait 30 seconds. Plug it back in. Try turning it on again. It should:

1. Boot up fine! (this means your RAM is A-OK, and that the error codes are just indicative of the fact that your computer is a piece of crap. Duh! You got a Dell!)

2. Error code again. (Take out a RAM stick and put a different one in and repeat the process of unplugging etc. till it boots up)

3. Error code different. If you hear beeps and just have a 1 showing, it means you took them all out and unplugged it and waited 30 seconds (or two minutes or longer) and then plugged it back in. That’s what I finally did. It accomplished some sort of hard reboot or something and cleared it’s memory or whatever. Torn it off, throw in some RAM (one stick if you don’t mind), and plug her in and boot her up. Should work unless you threw in the bad RAM.

If all this fails it means that all your RAM went bad at once. If so, please comment so i can know there’s someone out there more hated by their ocursed Dell minion than me! :D

So, again, the lesson here is that Dell sucks and no one should ever buy a Dell ever and that I hate Dell, and that I will never buy one again (and have put my money where my mouth is and although I have 10 Dells in my home, my most recent purchase was an HP).

“Dell Wars” Episode VII – Death of an Empire

Sunday, October 12th, 2008

Hey, wait, I thought I was done with Dell? Especially after the first six episodes? Yeah, and I thought Lucas was done making movies, but they keep coming, and it just keeps getting worse.

So, yesterday I decided to buy a new laptop. I’m recording an online Lecture series with IUPUI CSCI Dept. and I need a laptop to do it on. Now, I know what you’re thinking, “Surely… surely, he didn’t buy a Dell… right?” At this point, you’re probably expecting me to say “wrong”, but actually, I’m not a fracking idiot. I’ll never give Dell another red cent in my entire life. I bought an HP.

Modest 15.4″ Screen

4 GB Ram

2.1 GHZ AMD Turion X2 Ultra 64

Vista Home Premium

ATI RADEON HD 3200 Graphics card

WiFi

LightScribe Direct Disc Labeling DVD Burner

SD-MS/Pro-MMC-XD media card reader

Removable Remote Control thingamabob (so I can use it as a TV)

Lots of lovely little ports some of which I don’t know the name for (USB/eSATA/HDMI/Network/phone/monitor/etc)

So, I get this thing home. Get my wifi network back up and running, and low an behold, aparently this pissed off my Dell.

She must have gotten jelous of the new girl in town, because when I walked in the room after getting my lappy all up and running, the dell was deader than a doornail.

She won’t even turn on. She just sits there with front panel error codes indicating she has bad memory. No bios screen, nothing. Just a number 3 and a number 4 lit up in green, as if to say, “Fine! I’m leaving!”.

I even ripped out all the memory and hit the power button to see if it would give me the correct error codes for “no memory found”, but nope. It still claims to have memory, but claims the memory is bad.

Well, guess what Dell? That’s BS! You were going to remain my primary, but now it really does look like I’m abandoning you to the cobwebs of irrelevancy! Good ridance you over priced piece of crap! You never worked right in the first place!

If I didn’t think there was a chance I could fix it (probably have to buy a new motherboard, this will be it’s third one) I’d take it out back and beat the snot out of it with a baseball bat.

I HATE DELL COMPUTERS!!!!!!

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHH!!!

HTML E-Mail with PHP: 5 Pointers to Get ‘er DONE!

Tuesday, October 7th, 2008

Sending e-mail can be pretty useful with PHP. It’s also really easy… until you want to send HTML that is.

I used these two tutorials to learn how to send HTML e-mails in PHP:

sitepoint.com advanced e-mail tutorial
webcheatsheets.com sending e-mail tutorial

For something that requires very strict accurate guidelines to be followed, you would think they wouldn’t just gloss over them or ignore them entirely. But they did.

So, here are five pointers to get you off on the right foot:

1. Use Content-Type: multipart/alternative; with a random hash

Don’t just send the e-mail as HTML. Many e-mail providers don’t allow for HTML e-mails, so you need alternative content. You will need a boundary string, but you will also want it to be random hash. Why? Well, I’m not really sure. I can easily imagine one scenario, which would be that if you are sending mail on behalf of someone, and they figure out your static boundary string, they could do some sort of injection attack and send some nasty thing through with your e-mail. Not really sure if this would work, or if this is the reason, but everyone else uses a random hash, so you should too!

<?php
//create a boundary string. It must be unique
//so we use the MD5 algorithm to generate a random hash
$random_hash = md5(date('r', time()));
//define the headers we want passed. Note that they are separated with \r\n
$headers = "From: webmaster@example.com\r\nReply-To: webmaster@example.com";
//add boundary string and mime type specification
$headers .= "\r\nContent-Type: multipart/alternative; boundary=\"PHP-alt-$random_hash\"";
?>

2. Don’t use HEREDOC syntax

At first I was trying to just do this:

$msg <<<HERE
--PHP-alt-$random_hash
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Plain text stuff

--PHP-alt-$random_hash
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

<html>
<body>
<p>
Blah blah blah $var blah!
</p>
</body>
</html>
--PHP-alt-$random_hash--
HERE;

But it just wouldn’t work! I figured out you have to do it like this:

$message = "--PHP-alt-$random_hash\n\r" .
"Content-Type: text/plain; charset=\"iso-8859-1\"" .
"Content-Transfer-Encoding: 7bit\n\r" .  

"Hello World!!! \n\r" .
"This is simple text email message. \n\r" .  

"--PHP-alt-$random_hash\n" .
"Content-Type: text/html; charset=\"iso-8859-1\"" .
"Content-Transfer-Encoding: 7bit\n\r" .  

"<h2>Hello World!</h2>\n\r" .
"<p>This is something with <b>HTML</b> formatting.</p> \n\r" .  

"--PHP-alt-$random_hash--";

Pay special attention to where you are putting your \ns and \rs!!!

3. Get the from right!

When building your headers, don’t forget to include a from. This will make your e-mail more recognizable and professional. Don’t just include the from though, include a human readable value as well!

$headers = "From: An actual name <email@email.com>\r\n";

4. Don’t forget those trailing “–” after the final bondary!

Don’t forget those last two dashes on your final boundary:

--==Multipart_Boundary_{$semi_rand}x--

See them there at the end? You don’t put those on the others, so they are easy to forget on the final one. Also, it’s boundary with an “a”, not “boundry”… Yeah, I misspelled it the first time…

5. If things aren’t working, experiment

It took me a good hour and a half to get this working right. It all came down to those little \r and \n things in the end. I had to carefully add and remove them from different places until I got everything just right. The webcheatsheet code conveniently uses some buffer trickery to avoid this, but my web host does not support that, so I had to figure it all out myself. Here is a version of their code that actually works on my web hose (Dreamhost):

<?php
//define the receiver of the email
$to = 'email@gmail.com';
//define the subject of the email
$subject = 'Test HTML email';
//create a boundary string. It must be unique
//so we use the MD5 algorithm to generate a random hash
$random_hash = md5(date('r', time()));
//define the headers we want passed. Note that they are separated with \r\n
$headers = "From: webmaster@example.com\r\nReply-To: webmaster@example.com";
//add boundary string and mime type specification
$headers .= "\r\nContent-Type: multipart/alternative; boundary=\"PHP-alt-$random_hash\"";
//define the body of the message.
$message = "--PHP-alt-$random_hash\n\r" .
"Content-Type: text/plain; charset=\"iso-8859-1\"" .
"Content-Transfer-Encoding: 7bit\n\r" .  

"Hello World!!! \n\r" .
"This is simple text email message. \n\r" .  

"--PHP-alt-$random_hash\n" .
"Content-Type: text/html; charset=\"iso-8859-1\"" .
"Content-Transfer-Encoding: 7bit\n\r" .  

"<h2>Hello World!</h2>\n\r" .
"<p>This is something with <b>HTML</b> formatting.</p> \n\r" .  

"--PHP-alt-$random_hash--";

//send the email
$mail_sent = mail( $to, $subject, $message, $headers );
//if the message is sent successfully print "Mail sent". Otherwise print "Mail failed"
echo $mail_sent ? "Mail sent" : "Mail failed";
echo $message;
?>

Have fun! Feel free to comment if you have any other tips/questions.