Web Services from Awave, Inc.
Communications systems and services from Awave, Inc.
Computer & Network Systems and Services from Awave, Inc.
Video and Multimedia Systems and Services from Awave, Inc.
Consulting Services from Awave, Inc.
Contact Awave, Inc.
 

BF_logo_04_IS

PHP.net
MySQL Site

 

Factory-direct memory upgrades  

Save 30% on CuteFTP Pro  

Sirius Satellite Radio  

Rent Games and DVDs Online  

Top Rated Anti-Spyware Software – Free Download  

Free Animations  

Highly Recommended!

Visit these sites where we use what we teach here:

The Edge

A commercial site where really cool tie-dye clothing is sold. Uses PHP generated links to Mal's Shopping Cart.
 

Scifisource

Directory of Science Fiction and Fantasy sites. Search and category results pages use PHP generated tables to display results.

WebSite Pros

Tutorial:
Using PHP and MySQL with Fusion

© 2000-2008
Awave, Inc.

Tutorial - Get Fusion 10
dynamic web sites using PHP and MySQL

Contact the author

Lesson 2 - More Basics

PHP code and Fusion pages -

Fusion is an HTML code generator. A mostly WYSIWYG code generator. It's NOT an HTML editor. PHP extends the power of Fusion by allowing you to add dynamic content to your web pages - in part by generating HTML code itself when you need it to.

The "Insert HTML" box (aka 'the box') you access with Ctrl+T is still awkward to use in Fusion 9 and hopefully will by improved in the version of Fusion that follows. It's limitations are many - but it's what we have to use for now. We usually write code in PHPNotepad and copy it into the box. Then we fine-tune (read: correct our typos) in the box.

Using the box, you can insert code such as HTML code you write. For example; a lengthy list of items for a form combo box is often easier to place on a form by inserting code rather than using Fusion Forms Combo Box tool. It can also be used to insert Javascript and, of course PHP scripts. Or any combination of these. The box should probably be titled "Insert Code" instead of "Insert HTML", since you are not at all limited to only inserting HTML code.

When you insert code, you can drop in and out of PHP and into HTML as appropriate. In the example below, the two code snippets are equivalent. (just imagine you're looking at two "Insert HTML" boxes)

Note: notice that when you 'echo' or 'print' the results of a function - you don't use " " around the function.

Simple table using PHP - two methods

 <? 
  echo "<Table>";
  echo "<TR>";
  echo "<TD><P>";
  echo date("F jS, Y");
  echo "</P></TD>";
  echo "</TR>";
  echo "</TABLE>;
?>

<Table>
  <TR>
  <TD><P>
  <? echo date("F jS, Y"); ?>
  </P></TD>
  </TR>
</TABLE>
 



If you have CSS turned on in Fusion (highly recommended) the generated table will use the styles you have set in Fusion. Or you can insert your own style or formatting code if you wish to override the CSS styles you have set.

A word about PHP tags

The tags used in this tutorial ( <? and ?> ) are "short" tags. In most PHP 4 installations these are the default.

If you're stuck using PHP3 or you want to be XML compatible in the future, use the "XML" version instead (<?php and ?>).

If you're coming over from ASP and you can't get those tags out of your head, you can also use ASP style tags (<% and %>) as long as they're enabled in the PHP.INI file on the server.

You can even use "Script Style" tags like "<SCRIPT LANGUAGE='php'> and </SCRIPT>". This is NOT recommended. For one, it's the longest style and we type enough already, and secondly, if you're using JavaScript (which uses this style), you can cause yourself headaches with an improperly placed </SCRIPT> tag.

Try the exercise above if you wish. Then let's move on to basic MySQL.

Lesson 3 - Basic MySQL

Last Updated: 01/27/08

allwebmenus - Cross platform DHTML!