Category: PHP

PHP Alternating Color Table Rows for Drupal or Dreamweaver sites

This is based on the great tutorial by phpfreak at phpfreaks.com For a more complete explanation of this, take a look at his article.

The main variation I have made here is to adapt it for the drupal database and to separate the HTML more from the PHP to make it easier for designers to alter without needing to escape the code characters: a big source of errors for those of us who are not writing code day in and day out.

This will also work well dropped into a Dreamweaver-created php site – just change “nid” and “title” to whatever fields you want to display instead, and use the query dreamweaver generates when you define a recordset.

If you are new at this, it may go more smoothly if you first create a dynamic site in Dreamweaver, then create a dynamic table with whatever fields you want, THEN add in the additional code to generate the colors by comparing that file and this.

Continue reading

Alphabetical Title Browser for Drupal

Note: See also PHP Alternating Color Table Rows for Drupal or Dreamweaver sites

I needed an alphabetical browser of all published nodes, and couldn’t figure out how to do it using existing Drupal tools, so created one in Dreamweaver and made a static page out of it. Maybe someone can make a Drupal module out of? it. It needs at least four big improvements that I can think of –

1. The Dreamweaver connection code needs to be Drupal-ized
2. It is written in the backwards Dreamweaver way – the php gets inserted into the html, rather than having the php output the html as part of the stream of code.
3. It needs to have the alternating table rows
4. It needs to be paged, when the list gets too long.

Continue reading

Create Database-Driven Sites the Easy Way with GoLive 6

PHP/MySQL for the rest of us!
(originally published Spring, 2002)

Intro:
Designers now have a new tool to help them create php/mySQL-based
dynamic sites using without a steep learning curve. It is now
almost as easy to create a simple database-driven site as an html-based
one. Adobe’s GoLive 6 has improved their dynamic link module and
completely integrated it into the application. It now includes
php/mySQL support and plenty of help and templates for creating
your first database-driven website.

  • Why make a dynamic
    site?
  • Getting
    started.
  • How to talk
    to MySQL without a Ph.D.
  • Setting
    up the site in GoLive.
  • Adding Dynamic
    Content to your page.
  • Continue reading

    Installing PHP/mySQL scripts – Tips for Designers

    or …
    “Just Enough about Unix to get into trouble…”

    Determine type of server:
    I’ve found that PHP scripts work more reliably on Unix servers than NT. Also, be sure that the server is not running PHP as a cgi script. It really doesn’t work as well. How do you tell?

    phpinfo
    Upload a little file containing this code:

    <? phpinfo(); ?>

    Name the file “phpinfo.php” and then view that page online in your web browser. This is a php script that returns all the information about your server environment. In the first table of information, you will find “Server API.” This should be “Apache.” If it says “CGI” you are in trouble. However some things will work fine in this setup, so it’s always worth a try.

    Continue reading