Mike,

Thanks very much for your terrific reply.

On Oct 20, 12:49 pm, Mike Williams <[EMAIL PROTECTED]> wrote:
> I'd suggest getting your server working first, because it's possible to
> test your server without the client, but not the other way round. If you
> try to test both together it can be hard to tell where the problem lies.

My server "works" I think, in the sense that you could see my URL,
so I am not sure what you mean here. I can access my pages via
http://localhost/~brian/... only, not via the link 
http://schott.selfip.net/~brian/...
.
So I cannot tell if the outside world can see my pages.

If you, the user, clicks the "submit" button now, you get a new
screen
which actually is on the same PHP  page because of the following line
which you cannot see.

if (isset ($_POST['Submit'])) {

But right now the form is only being used for a recaptcha check which
I have temporarily partially removed. But you see the resulting
error message which results from the recapthca failing. So, again,
I think my server "works" but I cannot figure out a way to
keep the submit button on the page, off of the map, and not in
the marker.openInfoWindowHtml(iwform) as you do in
example_store.htm .

Am I going to be able to leave my "submit" button outside of the
Google map window like I have it now, instead of making it
part of the iwform as you show in example_store.htm?
I am thinking of things like the following 2 PHP statements
for my submit form, but I cannot get it right. For example
which version of the action parameter is right andI suspect
I need to not pass the method parameter. And

echo "<form method=\"post\" action=\"gmaps.php\"  onsubmit=
\"process(this); return false\">";
echo "<form action=\"#\"  onsubmit=\"process(this); return false\">";

In your example you make the variable lastmarker global with the
following javascript statement, right?

var lastmarker;

If so, then can I simplify by making the variable latlng global in
the
same way and then use the following code to test my script?
Actually I have tried this already, but I never get the alert, I just
get the receiving HTML page.

function process(form) {
  var lat = latlng.lat();  var lng = latlng.lng();
  alert(lat);
  alert(lng);
  }

>
> If you insist on doing it the hard way (without AJAX) then you should be
> able to test it by typing the Submit URL into your browser, something
> likehttp://localhost:gmaps.php?Submit=foo&lat=23.824&lng=-83.987
>

Your fine explanation at http://econym.googlepages.com/store.htm uses
GDownLoadUrl() to POST. Isn't that "the hard way (without AJAX)"?

When you say "test it by typing the Submit..." above, I assume you
mean
that while I am testing the application, I can separate the testing of
the
receiving of the new latlng and adding to the flatfile from the
testing of
the sending of the new latlng, right?

> When your gmaps.php script sees $_POST['Submit']) it should obtain the
> date on the server side, but it can't get the lat and lng from the
> server, you have to pass that from the client as in the URL above, then
> collect the data and append it to real.xml, and then NOT return a HTML
> page.
>

By "NOT return a HTML page", do you mean the "return false" in
example_store.htm phrase that follows, or something else?

onsubmit="process(this); return false"



> Read the passed parameters like
>   $lat=$_RECEIVE["lat"];
>   $lng=$_RECEIVE["lng"];
>
> I reckon it makes more sense to write a separate PHP script, rather then
> have one script that attempts to do two completely unrelated things
> depending on the presence of a "Submit" parameter.

Do you reckon this in general, or just in my application?

>
> At the moment, your server doesn't seem to do any of that. It seems to
> always display the HTML page whatever parameters are supplied.

I think I addressed this comment above.

>
> Once you've got he server working, you can either shove your Javascript
> variables into hidden input fields in your <form>
>   <input id="lat" type="hidden">
>   <input id="lat" type="hidden">

Yes, I had anticipated these as "hidden"s.

>
>   var mapClick = GEvent.addListener(map, 'click',
>     function(overlay,latlng){
>       if (latlng){
>         document.getElementById("lat") = latlng.lat();
>         document.getElementById("lng") = latlng.lng();
>       }
>     }
>   );

I am trying to avoid using GEvent.addListener() in favor of
the off-map submit button because I want users to be
able to drag their markers around after their initial
placement. But as I said above, I don't know how to
get the marked latlng into the off-map form.


>
> And similar for the dragend.
>
> Or you can use GDownLoadUrl(), like this:
>  http://econym.org.uk/gmap/store.htm
>
> Oh, by the way, your link does work.

Was it extremely slow in both loading and in reacting?

>
> --http://econym.org.uk/gmap
> The Blackpool Community Church Javascript Team

Thank you, Mike. You have put a lot of valuable time
into helping me and others, it is clear.

Brian

--~--~---------~--~----~------------~-------~--~----~
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