Forum Moderators: coopster & phranque

Message Too Old, No Replies

Scripting based solutions for every web site

what do you want to your site to do?

         

jatar_k

7:56 pm on Oct 1, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



With all of "where can I find a script that does..." posts that we have around here I have been thinking a lot about how us hard core programmer types might explain in the most basic of terms what scripting is and what uses it has on the average web site.

I am not talking about all of the functions or scripts we write or great heaping code examples. That is probably why the non script inclined webmasters among us are confused when they wander into our little corner here. I am sure that if we can get a little something in here to explain what it is and what it could actually be used for they might feel a little less overwhelmed by the whole thing.

Every web site employs methods that, either, already use scripting or where scripting could save a lot of time and effort.

The first that comes to mind is

Form Processing

Nearly every web site we go to has some kind of form on it for contact, feedback, ordering etc.

Why do I use scripting to process a form?

I can get some base information from the user, require certain fields and then format and store the data or send off an email telling me what the user had to say.

We don't really need to go into exactly how this is done but just to say that it is a solution that is available.

Counters and Tracking

From a basic little ticker style counter on your main page to a complex referrals to sales system. I have used these many times to get better statistics out of my sites to be able to better understand my users.

Each of the two above topics can be broken down many times and feel free to.

So Here is my actual question.

What do you use it for? (I left out many)
What do you wish it could be used for?
What might you use it for?

No code, just explanation of common tasks you use php/perl to make life easier. Try and keep it so we might be able to explain a few things to everyone who doesn't understand. At very least we all might share a few ideas.

Knowles

8:01 pm on Oct 1, 2002 (gmt 0)

10+ Year Member



The main use I get out of is simple templates. You make One header One Footer and One Menu. The onlything that has to ever change is the content. It saves hours off of coding on larger sites. It also makes for easier CMS for others to use to update the page as you only give them a few options they can actually change.

brotherhood of LAN

8:13 pm on Oct 1, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I follow with the templates...

I want to sort out what is static and constant information (like headers, footers) and create an interface to easily add the unique content.

The SSI aspect of PHP or any server side scripting language is the great thing about it for me - makes for much less code repitition and compacts a large site into a seemingly tiny site running off a db or two and a few files with some CSS stuck on :)

jatar_k

10:46 pm on Oct 1, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



the template sytem saves tons of time.

another quality one is a site search. You can customize the look of the results and make as powerful or as thin as you like.

jeremy goodrich

10:50 pm on Oct 1, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If this one sounds appropriate...

    user registration systems.
  • cookie handling
  • database interaction
  • password storage / retrieval

I've built a couple, and after two or three, finally got a working routine down. Never did retrofit the older ones, but the code got a lot better, the cookie handling improved, etc.

There are issues that crop up you just don't think about when you are coding it out the first time around.

dingman

3:41 pm on Oct 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've got a server-side navbar that adds links when I add content. Hardly the most complex thing I've written, but one of the ones I like best.

Not nearly so useful on an every-day basis, but also nice, are a couple relatively simple scripts that I put up at an old URL to send 301 redirects with all the get variables intact. (E.g., instead of static redirects sending [my.old.host...] to [my.new.host...] this script sends them to [my.new.host...]

I'm not sure I have a single page without some server-side scripting anymore. If nothing else, they all use my (simple, homebrew) template system to keep a uniform look and feel.

jatar_k

4:41 pm on Oct 2, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I'm with you dingman, I can't remember the last time I created a site that had no scripting at all.

It's hard to explain to someone that you can do anything you want. People ask me what I can do with php all the time. It isn't really an easy question to answer. I usually reply with "what do you want it to do?".

I have one particular site that is wrapped with about 5 different systems all interlinked. They share some data but are mostly individual systems. It is ridiculous the amount of things this site does. If I had to do even a quarter of it manually I wouldn't be able to do anything else.

love this stuff.

toadhall

5:33 pm on Oct 2, 2002 (gmt 0)

10+ Year Member



A good way to think of server side scripting, and to some extent client side scripting, is as "html pre-processing". Any data you can gather you can process into some form of html, including Javascript. Images too! *

There are two types of data available: environment data and user input.

Start by having a look at what data are available in the "environment", the stuff that's exchanged between machines on the 'net. Search for "server environment variables" with the search engine of your choice (ahem) and see for yourself. Not all of them will always be available and the method of retrieving their contents will vary according to platform and method (choice of scripting language), but the variable names and the type of data they hold remain the same.

Add user input to the mix, stir with your imagination and you'll have a better idea of what Jatar means by "you can do anything you want". Perhaps a *bit* exaggerated, but it feels like you can.

* Of course, html or other browser readable material is not always the final result of script processing. It may be used to alter the environment (redirect or ban misbehaving visitors for instance) without returning anything to the screen.

jatar_k

5:09 pm on Oct 3, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



user registration systems

these can be as powerful or as lean as you like.

You just want to protect a little content and have them register to see it.

You want to be able to more intuitively track your users (cookie/db) and see who is buying from what terms. Maybe how many times they return before they or what page they buy from.

You may want to serve personalized content so that users can enhance their own experience.

You may want to have a clients section where they login and it serves up all information relative to their account, ie. reports, status, who knows.

There are a lot of options for these systems and can add a lot of statistical data or stickyness to a site.

I use a login to serve up client reports and info. I also track how often the clients log in (time/date). Some clients never check these things, they just don't care, I just want to make sure I know who they are.