I just open my c drive and search then check my php file i didn't use
my website when check it. Because when I try to open php files from my
web it was failed the page not found.

This is the php file I was copying from google code playground anyway
is there a mistake?

<!--
  copyright (c) 2009 Google inc.

  You are free to copy and use this sample.
  License can be found here: http://code.google.com/apis/ajaxsearch/faq/#license
-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"; xmlns:v="urn:schemas-
microsoft-com:vml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/
>
    <title>Annisa I.R.: Google Maps API </title>
    <script src="http://maps.google.com/maps?
file=api&v=2&sensor=false&key=ABQIAAAAsEyM6Hy26psjtan1FoLfZxSaWCZ-
i61baQhrjXLwqyrMQALH3hSYEQqiHpEsHBpvQ-JcCxZ11mEfrA" type="text/
javascript"></script>
    <style type="text/css">
    body {
      font-family: Verdana, Arial, sans serif;
      font-size: 11px;
      margin: 2px;
    }
    table.directions th {
      background-color:#EEEEEE;
    }

    img {
      color: #000000;
    }
    </style>
    <script type="text/javascript">

    var map;
    var gdir;
    var geocoder = null;
    var addressMarker;

     var directionsPanel;
     var directions;


    function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));

        map.setCenter(new GLatLng(-6.8993, 106.875), 7);
        map.setUIToDefault();

        gdir = new GDirections(map,
document.getElementById("directions"));
        GEvent.addListener(gdir, "load", onGDirectionsLoad);
        GEvent.addListener(gdir, "error", handleErrors);


      }
    }

    function setDirections(fromAddress, toAddress, locale) {
      gdir.load("from: " + fromAddress + " to: " + toAddress,
                { "locale": locale });
    }

    function handleErrors(){
     if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
       alert("No corresponding geographic location could be found for
one of the specified addresses. This may be due to the fact that the
address is relatively new, or it may be incorrect.\nError code: " +
gdir.getStatus().code);
     else if (gdir.getStatus().code == G_GEO_SERVER_ERROR)
       alert("A geocoding or directions request could not be
successfully processed, yet the exact reason for the failure is not
known.\n Error code: " + gdir.getStatus().code);

     else if (gdir.getStatus().code == G_GEO_MISSING_QUERY)
       alert("The HTTP q parameter was either missing or had no value.
For geocoder requests, this means that an empty address was specified
as input. For directions requests, this means that no query was
specified in the input.\n Error code: " + gdir.getStatus().code);


     else if (gdir.getStatus().code == G_GEO_BAD_KEY)
       alert("The given key is either invalid or does not match the
domain for which it was given. \n Error code: " +
gdir.getStatus().code);

     else if (gdir.getStatus().code == G_GEO_BAD_REQUEST)
       alert("A directions request could not be successfully parsed.\n
Error code: " + gdir.getStatus().code);

     else alert("An unknown error occurred.");
    }


    </script>
  </head>
  <body onload="initialize()" onunload="GUnload()" style="font-family:
Arial;border: 0 none;">


   <h2>Google Maps API (Daerah yang berhubungan dengan saya)</h2>
    <form action="#" onsubmit="setDirections(this.from.value,
this.to.value, this.locale.value); return false">
      <table>
        <tr>
          <th align="right">Dari: </th>
          <td>
            <select id="fromAddress" name="from">
<?php
mysql_connect("localhost", "******", "******");
mysql_select_db("******");

$query=mysql_query("select * from locations order by name");

while($r=mysql_fetch_array($query)){
  echo "<option value='$r[lat],$r[lng]'>$r[name]</option>";
}
?>
            </select>

          <td>
            <th align="right">  Ke: </th>
            <td align="right">

            <select id="toAddress" name="to">
<?php
$query=mysql_query("select * from locations order by name DESC");

while($r=mysql_fetch_array($query)){
  echo "<option value='$r[lat],$r[lng]'>$r[name]</option>";
}
?>

            </select>

          <td>
        </tr>
        <tr>
          <th>Bahasa: </th>
          <td colspan="3">
            <select id="locale" name="locale">
              <option value="id" selected>Indonesia</option>
                <option value="en">Inggris</option>
                <option value="fr">Prancis</option>
              <option value="de">Jerman</option>
              <option value="ja">Jepang</option>
              <option value="es">Spanyol</option>
            </select>
            <input name="submit" type="submit" value="Cari Rute!" />
          <td>
        </tr>
     </table>
    </form>
    <br/>
    <table class="directions">

      <tr>
        <td valign="top">
          <div id="directions" style="width: 275px"></div>
        <td>
        <td valign="top">
          <div id="map_canvas" style="width: 310px; height: 400px"></
div>
        <td>
      </tr>
    </table>
  </body>
</html>

On May 26, 10:04 pm, Andrew Leach <[email protected]> wrote:
> On May 26, 3:23 pm, PacarTora <[email protected]> wrote:
>
> > can I send the php file instead? it was in my laptop anyway. So this
> > is how I upload i make a web using  this 
> > sitehttp://www.freewebhostingarea.com/
> > and then i follow the instruction and then i upload the php file 
> > inhttp://ueuo.freewebhostingarea.com/ftp/index.php. And then check my
> > web and it doesn't work and then I trying to check the php file try to
> > find the wrong code I change some code but still like that.
>
> How do you "check your file"? It is that URL which we need.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to