Oh sorry here is current page & relevant PHP:
http://www.dockhawk.com/
<?php
session_start();
if ($_GET['token'] !== $_SESSION['token']) {
die('Invalid token');
}
$coin = $_SESSION['token'];...
//more code
...
// Start XML file, echo parent node
echo '<markers>';
// Iterate through the rows, printing XML nodes for each
while ($row = @mysql_fetch_assoc($result)){
// ADD TO XML DOCUMENT NODE
echo '<marker ';
echo 'operator="' . parseToXML($row['operator']) . '" ';
echo 'name="' . parseToXML($row['name']) . '" ';
echo 'waterway="' . parseToXML($row['waterway']) . '" ';
echo 'mile="' . parseToXML($row['mile']) . '" ';
echo 'address="' . parseToXML($row['address']) . '" ';
echo 'town="' . parseToXML($row['town']) . '" ';
echo 'state="' . parseToXML($row['state']) . '" ';
echo 'lat="' . $row['lat'] . '" ';
echo 'lng="' . $row['lng'] . '" ';
echo 'county="' . parseToXML($row['county']) . '" ';
echo '/>';
}
// End XML file
echo '</markers>';
//begin coin tag
echo '<coin>';
echo '<coin ';
echo 'newcoin="$coin" ';
echo '/>';
//End coin tag
echo '</coin>';
?>
On Oct 6, 4:29 pm, Lan Mind <[EMAIL PROTECTED]> wrote:
> Thanks for that example of passing the token with the same server call
> William. It worked and now I'm trying to pass the token back in the
> XML. Is it possible to call two different javascripts from one
> onsubmit button?
>
> My thinking is that I need to redefine "var coin" on my HTML page in
> the same script. So the getcoin() function is undefined because it's
> looking for it in "javascript.js" but it's at the top of the HTML.
>
> I sent the token back in the XML as a PHP var $coin. This killed my
> search results some reason, lol. Looking at the returned XML it is in
> it's own marker row "<coin>". I was going to redefine var coin in the
> getcoin(); function.
>
> BTW I haven't changed the token in the PHP to ensure it's used only
> once until I know it's being passed back from the server correctly.
>
> On Oct 6, 2:13 pm, William <[EMAIL PROTECTED]> wrote:
>
> > On Oct 7, 4:26 am, Lan Mind <[EMAIL PROTECTED]> wrote:
>
> > > I'm worried about putting the PHP inside the
> > > javascript, script inside a script?
>
> > maybe the easiest way is to create a global variable as the first
> > script in your homepage
>
> > <script type="text/javascript">
> > var DockhawkToken = "<?php echo $_SESSION['token'] ?>";
> > </script>
>
> > then append it to the URL when you call your javascript
>
> > onsubmit="getMarks(this.action + '?name=' + escape(this.name.value) +
> > '&token=' + DockhawkToken); return false;"
>
> > function getMarks(url)
> > {
> > var request = GXmlHttp.create();
> > request.open("GET", url, true);
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---