Jump to content

help with getting to execute code from a db


Jalz

Recommended Posts

Hi Guys,

 

I have the following script which works fine for GoogleMaps

<?php
require'EasyGoogleMap.class.php';
$gm = & new EasyGoogleMap("rYvyXhRFPYW5tkV_IE5hWxecUidHAYjJhBSp59xzQuNZcoxNYCiaum4_Xb66Fw");
$gm->SetMarkerIconStyle('STAR');
$gm->SetMapZoom(10);
$gm->SetAddress("10 market st, san francisco");
$gm->SetInfoWindowText("This is the address # 1.");

$gm->SetAddress("Manila, Philippines");
$gm->SetInfoWindowText("This is Philippine Country.");
$gm->SetSideClick('Philippines');

?>
<html>
<head>
<title>EasyGoogleMap</title>
<?php echo $gm->GmapsKey(); ?>
</head>
<body>
<?php echo $gm->MapHolder(); ?>
<?php echo $gm->InitJs(); ?>
<?php echo $gm->GetSideClick(); ?>
<?php echo $gm->UnloadMap(); ?>
</body>
</html>

 

I've now coded that static page to take the following, and within the GoogleMaps database field entered in exactly the following $gm->SetAddress("10 market st, san francisco");

$gm->SetInfoWindowText("This is the address # 1.");

 

$gm->SetAddress("Manila, Philippines");

$gm->SetInfoWindowText("This is Philippine Country.");

$gm->SetSideClick('Philippines');

 

 


<?php

$maps_find = $OO_Open->newFindCommand('Maps');
$maps_find->AddFindCriterion('AccountName','xx');
$maps_result = $maps_find->execute(); 
$maps_row = current($maps_result->getRecords());
$Gdata = $maps_row->getField('GoogleMaps');

//echo $Gdata;
//exit;


?>

<?php
require'EasyGoogleMap.class.php';
$gm = & new EasyGoogleMap("my key");
$gm->SetMarkerIconStyle('GT_FLAT');
$gm->SetMapZoom(10);
$gm->SetMapWidth(1080); # default = 300
$gm->SetMapHeight(550); # default = 300

echo $maps_row->getField('GoogleMaps');
//eval("\$Gdata = \"$Gdata\";");

?>


<html>
<head>
<title>EasyGoogleMap</title>
<?php echo $gm->GmapsKey(); ?>
</head>
<body>
<?php echo $gm->MapHolder(); ?>
<?php echo $gm->InitJs(); ?>
<?php echo $gm->GetSideClick(); ?>
<?php echo $gm->UnloadMap(); ?>
</body>
</html>


 

Is there way of getting the $maps_row->getField('GoogleMaps'); command to behave as if it was php (when I echo it, it does display the code as text). I'm not using the FileMaker db to store the code, I thought eval function was the answer but not had much luck.

 

Many Thanks for the advice

 

Jalz

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.