Archive for January, 2003

Plethora of php and myql examples

Thursday, January 30th, 2003

I finally got a chance to click on the link to Brenna’s page from Girlie’s post about the comments (see my last post)… Wow! She’s got a ton of great examples for php and mysql and stuff there

Who comments the most?

Thursday, January 30th, 2003

Girlie has a script that will show who comments the most on your blog.

(that looks really fun - I think I’ll be implementing it on my personal blog)

mySQL LIMIT, Table Joins, and creating CSV files

Thursday, January 30th, 2003

Last night in my freelance work, I hit the “A-HA” moment on three seperate issues I’d be fighting with for a long time. Probably simple concepts to some people, but they were a bit of struggle for me. I just wanted to make a note (partially to myself) about what I learned, so I don’t forget it! And also, in case it helps somone else who had been fighting with the same concepts.
(more…)

border and background color tester tool

Tuesday, January 28th, 2003

Here’s a neat little table border and background color tester tool.

easy includes for php

Saturday, January 25th, 2003

I don’t have much time to browse the MT forums - but had some “downtime” this afternoon to do so. There’s often a lot of tricks for PHP in there. I found this thread, and towards the bottom, phideaux posted a neat trick to make using includes in your code easier.

The idea is you always use one directory for your includes. In your .htaccess file you add this line

php_value include_path “.:/home/user/public_html/includes”

Then any time you want to use an include in your file, you don’t have to deal with typing out the big long absolute path (ie. /home/user/public_html/includes etc etc). All you need do is this:

<?php include(”header.php”); ?>

Neat trick! :)

hover trickery

Friday, January 24th, 2003

I’m always inspired when I go to the css/edge site, but I’ve just found the tutorial over there for Pure CSS Menus and its just such a cool concept — using the :hover attribute for other elements is great, and I hope that all the browsers will eventually support this. For now, its Netscape/Mozilla specific, but still cool.

And then, I found #misguided through web-graphics and there’s several easy ideas for Image Rollover Code and Expanding List Script. Its so easy that anyone should be able to implement it, not just javascript/dHTML goddesses!! :)

Proper testing for browser types

Wednesday, January 22nd, 2003

Since my site (domesticat.net) is skinned, I use PHP to test for a handful of browsers that require certain types of skins. In practice, this points lynx browsers to the lynx skin, and the PDA-type browsers to the ultralight skin.

Zalary (of everythingfalls.com) emailed me this morning to let me know that I’d made a goof, and that one of the text strings I was testing for now trips up under a Mac-based browser, Avant, that I’d never heard of before.
(more…)

Bloggies

Tuesday, January 21st, 2003

Hot damn! So the bloggie nominations are out, and scriptygoddess was nominated in three categories. Damn. I don’t even know what to say. I guess, Thank you!!! would be a good start. :D Based on the trackback pings I knew people were voting for this site for the nomination in the “Best Web Development Weblog”… but never in my wildest dreams did I figure I’d get on the list, AS WELL AS in two more categories. (”Best Programming of a Weblog site” and “Best Community Weblog”). Damn!

This site started as a way to track my learning in PHP and Javascript, etc. I quickly saw the value in adding authors - and thus it became a multi-person learning effort. I’m so glad that it has been useful to the blogging community. To everyone who nominated Scriptygoddess - and especially my partners in crime (my co-authors)…Thanks everyone! :)

404 redirects

Tuesday, January 21st, 2003

I recently converted several sections of my site from html to php, and I wanted an easy way to change over without uploading a redirect page in the place of each html page. So I came up with this option.

Required:
Your server must allow you to use php pages for error messages.
If that’s not the default, you’ll need access to the htaccess file to make the change.
You will need to delete the .html files from the folders you are uploading .php files in their place.

For example, I have a folder at http://love-productions.com/about/. It previously had index.html, lp.html, k.html. Now it has index.php, lp.php, and k.php and I’ve deleted the html pages. So if you visit /about/index.html, it will redirect you to /about/index.php.
(more…)

Getting the current URL with php

Monday, January 20th, 2003

There was a problem with one of the script I’d posted (I think we actually found a different way altogether of doing it) but it was an issue with $PHP_SELF when used in a file that gets included - it ends up showing the name of the INCLUDED file (not the current url).

Just for my future reference, I just tried this instead of PHP_SELF and it seemed to work ok with includes.

“http://”.$_SERVER['HTTP_HOST'].$_SERVER['PATH_INFO']

Alternatively - if there’s a “query string” at the end of the current url that you want to grab as well (ie http://www.domain.com/test.php?variable=value) you can add this onto the end of the line above:

.$_SERVER['QUERY_STRING']

(side note the . is just used to concatenate the different parts)