Code to generate this page:
<?php
include_once("../include/GoogleMap.php");
include_once("../include/JSMin.php");

//Set defaults
$DIRECTIONS_CONTAINER_ID = "map_directions";
$MARKER_LAT = "40.015362";
$MARKER_LNG = "-105.279123";
$MARKER_HTML = "
    Boulder, CO<br />
    Need directions?
    <form action=''>
    Get directions
    <select name='tofrom'>
    <option value='to'>to here</option>
    <option value='from'>from here</option>
    </select><br />
    Address:
    <input type='text' name='address' /><br />
    <input type='submit' value='Get Directions' />
    </form>
";
//Get posted variables
$ADDRESS = isset($_REQUEST["address"])?$_REQUEST["address"]:"";
$TOFROM = isset($_REQUEST["tofrom"])?$_REQUEST["tofrom"]:"";

//Instantiate Object.
$MAP_OBJECT = new GoogleMapAPI();
$MAP_OBJECT->_minify_js = isset($_REQUEST["min"])?FALSE:TRUE;
$MAP_OBJECT->setDSN("mysql://user:[email protected]/db_name");

//Show directions or just marker.
$MAP_OBJECT->disableSidebar();

if( $ADDRESS != "" ){
    if($TOFROM == "to"){
        $START_ADDRESS = $ADDRESS;
        $DESTINATION_ADDRESS = $MARKER_LAT.",".$MARKER_LNG;
    }else{
        $DESTINATION_ADDRESS = $ADDRESS;
        $START_ADDRESS = $MARKER_LAT.",".$MARKER_LNG;
    }

    $MAP_OBJECT->addDirections($START_ADDRESS, $DESTINATION_ADDRESS, $DIRECTIONS_CONTAINER_ID);
}else{
    $MAP_OBJECT->addMarkerByCoords($MARKER_LNG, $MARKER_LAT, "Marker in Boulder, CO", $MARKER_HTML);
}

?>
<html>
<head>
    <?=$MAP_OBJECT->getHeaderJS();?>
    <?=$MAP_OBJECT->getMapJS();?>
</head>
<body>
    <?=$MAP_OBJECT->printOnLoad();?>
    <?php if($ADDRESS != ""){?>
        <a href='advanced_marker_directions_2.php'>Remove directions</a><br />
    <?php } ?>
    <?=$MAP_OBJECT->printMap();?>
    <div id="<?=$DIRECTIONS_CONTAINER_ID?>"></div>
</body>
</html>