Industry guru Dave Taylor answers questions about a wide variety of technical topics, including HTML, online advertising, Cascading Style Sheets, Web design, Unix, Linux, search engine optimization, Mac OS X, shell script programming and Microsoft Windows.

How can I add a Froogle search box to my site?

I saw your article about adding an eBay search box to your site - very cool - and would like to find out how I can add a search box for Google's Froogle shopping service to my page. Ideally, I'd like to have it open up in a new window when someone does a search. Can you help me out?

How do I add a 301 redirect to my Apache httpd.conf?

I just checked and apparently both the "domain.com" and "www.domain.com" work for my site, bringing up the same page with different URLs. According to an SEO buddy of mine, that's a bad thing. Is it? And if so, how can I tweak my web server configuration to fix it?

How do I get local time with the PHP time function?

Hello I have a website and I show the time using:

<?php
\011

$fecha = time ();
\011echo "Date: " . date ( "j/m/Y" )."&nbsp;&nbsp;";
\011echo "Time: " .

date ( "h:i A" , $date )

But the time in my webserver is different from my time and I wanna display my time in my website, how can I modify the time? for example if the time in my server says 5pm i want to show 6pm

How can I add the Ask Dave Taylor RSS feed on my Web site?

I hate to sound like a groupie or something, but I love your site, Dave, and I'd love to be able to include a little box somewhere on my own site that featured your latest entries! Is this doable, and if so, how do I do it?

How do I detect the Sony PSP Web browser on my site?

I'm looking to make a Sony PSP optimized website, but I want it so that it can only be viewed by the PSP and if viewed in a normal pc internet browser, you have a message saying "please visit us using your psp" or something along those lines. How do I do that?

How do I add current weather to my website?

I have a new Web site and I'd really like to be able to add a little weather "bug" to it so people can check on the weather in my neighborhood. I've looked at some sites that offer weather forecasts but am completely befuddled. How do I add a weather forecast box to my Web site?

phpBB trick for including Google AdSense between articles?

I'm running phpBB for my site discussion forums and really like it, but I'd like to slip some advertising between forum posts #1 and #2 on my pages. For the life of me, though, I just can't figure it out. Can you help out?

What is Ajax?

I've been hearing a bit of a buzz lately about a new Web technology called Ajax, but I have no idea what it is or even how to find out more about it. Help?

How do I add the Technorati search box to my Web site?

My question is about the Technorati search box. How do I move the search box over to the right so it's not jutting outside the sidebar?

How does CGI work?

I maintain a website for a grammar school and I would like to put a form in on our alumni page with their name, graduating year and email address. I can create the form on Frontpage or Dreamweaver, but I don't quite get how the info is sent out. I would like the info sent to a particular email address but I don't know where to put that email address. Can you help?

What's a fast way to add a shopping cart to my site?

Dave, I have a few different books and audio CDs I'd like to sell and am wondering if you can recommend a quick and fast way for me to add some sort of an online store on my Web site so it's "commerce enabled", even a rudimentary one?

Using PHP to create a membership Web site?

I would like your recommendation on integrating php scripts on the website to create free membership or paid membership access only web pages. Are there any books that teach you how to do that in the most simplest way? I'm quite new to website building and still in the process of learning html. I would appreciate your advice. Thank you.

Technorati Searchlet doesn't work on my site?

Dave, you can restore my sanity. I'm trying to get the Technorati searchlet to work on my Web site and the darn thing just isn't working out right. I've even blogged about it to no avail. Help!

How can I hide an HTML form's email address?

I really enjoyed your article about the "mail to" problem many of us rely on for folks to contact us for one reason or another.

While I am just a geekette wanna-be, and am at best a stumbling dabbler in script and coding, I was wondering if you could share greater detail about how you scripted your contact form? When I took a look at the source code, not that I understand a lot of it, I was unable to determine how the message gets to where it needs to go without specifying the destination in the HTML?

Can I change my Web page based on time of day?

Dave, I need your help. I'm updating my Web site for The David Lawrence Show and would like to display 'ON THE AIR' between 7p and 10p PT (3a to 6a GMT) Monday through Saturday, and 'OFF THE AIR' the rest of the time. How do I do this? Later, I can easily replace this displayed text with an image tag once I find an on-air light graphic that doesn't look like it's from 1943. :-)

Can I selectively block people from visiting my Web site?

Dave, we've got a problem. I help run a Web site and we're finding that there's one troll out there (yes, I read your article on trolls a few days ago!) who keeps showing up and posting inflammatory comments, really ruining the guest book for everyone else. Is there a way to selective block one person without just tossing the whole guestbook out?

How do I create a JavaScript countdown timer on my Web page?

Dave, being a new web developer I would like to know how I can code for a numeric value to decrease by 1 every 24 hours based on the local time function.

Specifically, we are trying to create a reminder for our employees of an upcoming DoD audit in the facility. The count down will represent the number of days remaining before it's conducted. So what I need to do is begin with a date and start the countdown from there. What is the code that I should use?

How do I automatically print the results of an HTML FORM?

Dave, I remember reading your book Creating Cool Web HTML 4 Web Pages and seeing a sample about a sub shop where online customers could order sandwiches...

Can you help me find a script that will take FORM information and upon submit, send it directly to a network printer? This is for a local courier service I am building a site for and I would like to offer them real time, print outs of web based delivery orders.

Does Paypal have a merchant referral program?

Dave, I've been happily using Paypal as a merchant account and shopping system for years now, and would like to turn on a few of my colleagues to this fast and simple system. If possible, I'd like to get some sort of commission or referral bonus. Does Paypal offer such a thing?

How do I sum up answers on an HTML Web-based form?

Dave, I just want to add numbers together, get an answer, and retrieve a document represented by the answer. I have 11 pages for people to answer "yes" or "no" on. I have my "yes" and "no" buttons working properly. What I need to do is assign numerical values to each button on each page. Then I need to add the values of all 11 pages of each button pushed to get one answer. I want to use this answer to retrieve one document to be displayed for the viewer. Maybe you know of some tricks that can be used in HTML to do this. I was thinking if I can't do it in HTML, maybe javascript might be an answer.

How can I add a Google search box to my Web site?

Dave, I keep visiting sites and seeing these cool search boxes that let you either search their entire site or search the entire Google database, all without leaving that page! I want to have something like this and would appreciate your helping me figure out the code needed.

How can I use Javascript and CSS to display the date?

I received this email from a younger reader: "Dave, thanks for your cool book Cool Web Sites, but I still need a bit of help. I want to have a little box on my page that shows the person the current date, like you'd see on a day-a-page calendar. I figure you can do that in CSS and Javascript, but I can't figure it out. Can ya help me?"

Why would I bother with a Weblog or Blog when I could just build a regular Web site?

My sister and I have been engaged in a dialog about the merits of weblogs versus traditional Web sites and it's evolved into a quite interesting discussion. She asks: "I still don't see how a blog would be better for me than a web site. I don't see why a person would want to come to my site often to see what I'm up to."

How do I add new "ping" sites to a Movable Type Blog?

A pal of mine who is a prolific writer but not so much of a techie asked me the following question: "I've just heard that feedster added a feature where I can automatically ping them when I have new entries for my Weblog. I use Movable Type daily, but I'm darned if I know how to add a new ping host to my blog configuration. Help!"

How can I delete Movable Type (MT) blog comment spam easily?

A technical wizard pal of mine asks: "I have all sorts of challenge/response barriers to comment spam on my Movable Type weblog, but occasionally someone goes through the work of identifying themselves and still leaves some silly spam comment. I want to delete it, but right now I get the email notification of the new comment, then have to log in to the administrative interface, find the comment, and delete it by hand. Quite a hassle. Isn't there a better solution to this?"

Can I bulk fix PHP require/include references?

A pal of mine asks: "Ugh.. I'm facing server-move Hades.. am moving my site dadsrights.org to a hosted solution, and I have dozens and dozens of files with PHP require_once() includes like "/www/dadsrights/XX". They all need to be changed to "/nfs/www/dadsrights.org/XX". Help!!"

How do I map XX.com to www.XX.com in Apache?

I've been keeping an eye on a very interesting discussion about the difference between the Google pagerank of pages on a "www" domain name and the same page without the "www" prefix (e.g. "www.intuitive.com/index.html" versus "intuitive.com/index.html"). Google calculates pagerank based on quite a few different criteria - as detailed in my article How does Google figure out what pages are more relevant? Pagerank. - and if you care about that, and you should, you should be automatically mapping all non-www URLs to their www equivalent.

And here's how to do just that...

How to use Apache htaccess to password protect a directory

In a rather lengthy email message, a reader writes to me that:
I am following your book Creating Cool Web Sites with HTML, XHTML and CSS and am trying to protect a subdirectory on my website. The following is the .htaccess code
AuthUserFile /www.bvg.us/uswholesale/uspasswords/passwords.txt
AuthGroupFile /dev/null
AuthName "Please enter your login name and password"
AuthType Basic

<Limit GET>
require user weiyang
require user annawei
</Limit>
The "passwords.txt" reads
user weiyang:wy
user annawei:aw
By doing so, I can get the "log in" box but can not login with the info that I set. Could you help me on this?

Password protecting individual files?

A reader writes:
I know about the ".htaccess" file as a way of protecting entire directories, but I'm wondering if I can use the ".htaccess" file to require a username and password in order to access a single file while allowing the rest of the directory to remain open?

Incorporating data from Movable Type into your Web Pages

This is a kinda tricky one, but it was based on some inspiration I got when working on my Real Life Debt Weblog: could I figure out a way to incorporate weblog data into non-blog pages? The answer is, yes!

For this experiment, I decided that I'd like to have a new sentence on the intuitive systems home page that always showed the two most recent entries in my intuitive life weblog...

How do I add a custom 404 error page?

A reader writes:
Your intuitive.com site (which I love, by the way! great site!) has a custom error page when I enter a bad URL. I've seen that elsewhere too, but don't really know how to do it. Any hints?

Interesting JavaScript code example: finance calculator

I've been building a financial calculator that lets you enter a monthly payment, an interest rate level and an overall debt level, then tells you how long it'll take to pay off the loan and how much interest you'll end up paying. It's fairly self-explanatory, I think, and interesting to read.

First off, here's the JavaScript:

<script type="text/javascript">
<!--
// Script written by Dave Taylor based on some math suggested by
// Bennett Haselton @ Peacefire.org. Thanks Bennett!

function centNotation(value)
{
  // return the value in normalized dollars.cents notation

  dollars = Math.floor(value);  // chop floating point portion
  cents   = Math.floor((value % 1) * 100);              // and chop everything else
  if (cents < 10) cents = "" + cents + "0";

  return(dollars + "." + cents);
}

Shopping carts and JavaScript

A reader writes:
Can one develop a web site for e-commerce that utilizes a shopping cart function and credit card processing without the use of JavaScript? Perhaps this question is addressed later in portions of the book I haven't gotten to yet.

How do I get a CGI form to work?

A reader writers:
"I'm trying to create a guestbook using the forms and CGI's, but I'm stuck as to how to link the form to the server. The sign page is at <guestadd.html> and I would like the view page to be at <guestbook.html>. What I did was use a somewhat template form of guestbook provided by our web host, and, after editing the sign page (new additions are "Current Division" and "Mu Alpha Theta Chapter"), wanted the additions to appear on guestbook.html, but I don't know how to do that..."

Password protected Web pages

A reader asks:
How do you think that i could make a login page with a password using CGI script?
There are two main ways to create a password-protected Web area...


Need Help? Ask Dave Taylor!
Search


Subscribe to
Ask Dave Taylor!

RDF XML
Add to My Yahoo!
Subscribe in NewsGator Online

”LiveMessage

Updates via Email
sent twice monthly

Want to feature Ask Dave Taylor Q&A articles on your own Web site, for free? You can! Find out how.
Auctions & Online Shopping
Building Web site traffic
Business & Management
Cell Phones and Mobile Phones
CGI Scripts & Web Site Programming
Computer & Internet Basics
d) None of the Above
HTML, XHTML & CSS
Mac OS X Advanced
Mac OS X Basics
Pay Per Click (PPC)
Search Engine Optimization
Shell Script Programming
Sony PSP & Gadgets
Sun's Solaris Unix
The Writing Business
Unix & Linux Basics
Unix & Linux System Administration
Weblogs and RSS Feeds
Windows Basics


Recent Entries on Ask Dave Taylor!
Join the List!
Join my author info mailing list, where you'll learn about my upcoming books, speaking gigs, and more!


Book Links

sitemap   --   link to us!