Thursday, June 25, 2009

The IE Input Image Catch

While working hard at my work (which is why this post is short), I was creating a site that used image inputs. All was well and good when running it in FireFox, but in Internet Explorer, it was a different story.

Problem:
Checking for the input name in the POST variable when using an image type, the PHP looking for the name could not find that input object.

Solution:
Internet Explorer as well as some other browsers, pass the x and y of the image you used for submitting your form instead of the input name. To detect these with PHP, you can check for

isset($_POST['image_x']) || isset($_POST['image'])

if either is true, you can continue to process. You may also note that the browser has converted what would have been image.x into image_x. The period character is swapped out.

Now you should be able to have your input be detected in all major browsers.

Monday, June 8, 2009

Mounting CDROM on Linux

Since I have used Linux for only a short while, I am not familiar to everything CLI (command line interface) and all the commands. When mounting a CDROM disc in CentOS 5.3, I found that all the forums didn't seem to help with the issue I was having. After some time, the answer was simple and I decided to post it here for anyone else who might be having the same issue.

Problem:
Mounting a CDROM in Linux from command-line.

Solution:
After several various attempts and ensuring I was root (sudo user) I was finally able to figure it out. My first error was that I did not add the type for what I was trying to add (in my case I wanted to run a program from the CDROM, if you are trying to play music, you do not need to mount your CDROM disc this same way, just open your music app and go). After looking up that the type for cds is 'iso9660'. I next ran into an error where my mount point did not exist, (in my case I was using the mount command ' mount -t auto /dev/cdrom /mnt/cdrom ').

I went to my mnt directory and mkdir the folder cdrom.

When I ran my mount command again, it mounted the cdrom is read-only mode and worked.

The solution of creating a mount point (folder) was simple enough but difficult since no one seemed to say it. I hope this helps you.