: For the geeks: Did I mention I love PHP?



Sinister Angel
02-05-05, 03:58 PM
I think my streak over the past few days of Apache/directory listing customization is a message from god that I should start coding more and actually learn PHP instead of hacking shit together as I go.

Few days ago I got bored and started playing around with Apache's HeaderName and ReadmeName directives. Well, I had played around with them prior because a friend wanted to know how to change the link color for his directory listings on his site, but I didn't really get too involved, just did some code to call a CSS file.

Then, like I said, I started playing with customizing directory listings a few days ago a bit more heavilly. At first, I wanted to change the header so it said "Thank you for perusing the directory listing of *dir*"
Well, I tried using SSI (which I more or less gave myself a crash course in) and tried echoing PATH_INFO. But for whatever reason, I couldn't seem to get that to work. No big deal - I have PHP :D

Well, I originally tried using a php file itself in the HeaderName directive - then I found out that it only takes files with the mimetype of text/*. Well, that's a nogo for PHP (Remember kids, PHPs mimetype is application/x-httpd-php). Oh well, no big deal, back to using server side includes. Well, that works like a champ. Only problem is that it will show the sorting options if the link is clicked. I'll save that problem for another day.

On to the ReadmeName directive. I wanted to throw in my "Song of the Day" and the lyrics. That was easy. Had the SotD in another file. Simple SSI call. I then thought "Hey, I wonder if I can make this thing show what song I'm currently listening to in winamp..." A while back, I had a program that allowed me to telnet in and control winamp. I figured a little reading of PHPs documentation on fsockopen() and some other stuff should do the trick, but I couldn't seem to find that plugin. I did however find something else, which in the end probably made my life 10 million times easier. I got the plugin httpQ, which more or less takes http requests and returns data based on parameters. What's even nicer is that the creator threw sample PHP code on his site for a user defined function for making the call to the plugin. Dear Diary: Jackpot!


Sorry for the long post that probably is kinda lame, but I just felt like sharing the return to my geek roots. If anyone is interested in seeing the site and/or source, let me know.

Kev
02-05-05, 04:10 PM
I have PHP
Man, sorry to hear that dude. Do doctors have a cure for that yet? :p
I'm not 'Geeky' enough to understand everything you did, but I do know the feeling of accomplishment in tweaking files and such with the result of bending GUI's to your will.
Nice! ;)

Kev

Ralph
02-05-05, 04:14 PM
What's this thread about :confused: :hide:

Kev
02-05-05, 04:39 PM
What's this thread about :confused: :hide:
Computer stuff man! Friggin binarry code and @#$*.
Try to keep up here Ralph. :lildevil:

Kev

Sinister Angel
02-05-05, 05:24 PM
Computer stuff man! Friggin binarry code and @#$*.
Try to keep up here Ralph. :lildevil:

Kev


Hahah, actually, it's all ASCII :thumbsup:

Kev
02-05-05, 05:29 PM
Hahah, actually, it's all ASCII :thumbsup:
Yeah, I know, I'm just havin too much fun. ;)

Kev

evilrussian
02-05-05, 05:30 PM
Ugh.. I can relate to that :( Although I'm a n00b when it comes to PHP, I do have Apache running on my FreeBSD box. I keep trying to motivate myself to do some more learning... But, my family and my job eat up most of my time that used to be allocated to geeky stuff :(

Sinister Angel
02-05-05, 08:10 PM
Ugh.. I can relate to that :( Although I'm a n00b when it comes to PHP, I do have Apache running on my FreeBSD box. I keep trying to motivate myself to do some more learning... But, my family and my job eat up most of my time that used to be allocated to geeky stuff :(


I know how that goes. It also helps to have a project in mind, or a goal you want to accomplish.

D148L0
02-05-05, 08:21 PM
Err... is good to see you around, Sinister. Even if it's to post this kind of H4x0r-not-suited-for-regular-folks stuff.

D148L0
02-05-05, 08:22 PM
Hey! I remembered this thing... tee hee!

Sinister Angel
02-05-05, 11:30 PM
Err... is good to see you around, Sinister. Even if it's to post this kind of H4x0r-not-suited-for-regular-folks stuff.

Hehehe, that shirt is good. Yeah, I haven't really been active in any boards lately for whatever reason. Just have felt.... lazy I guess you could say. Kinda hard to explain.