PHP - Iframe Markers
i am tryin to use google map iframe . the $ts4 and $ts5 from the db. Can i generate multiple markers if not can any1 direct me to a link to do so.
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.co.in/maps?f=q&source=s_q&hl=en&geocode=&q=<?php echo "$ts4,+$ts5"; ?>&ie=UTF8&hq=&hnear=<?php echo "$ts4,+$ts5"; ?>&z=14&iwloc=A&output=embed"></iframe> Thanks Similar TutorialsHello all, I am a relative newbie, and have been recently trying to get to grips with the Google Maps v3 API. I'm hoping someone here will be kind enough to take pity and help me with some difficulty I am having. First, let me set the scene. I'm helping a friend develop a website for a hobby. It's a simple, PHP / MySQL based site which lists different establishments. There is a database of companies, which includes a name, address, long lats, etc. I have managed to write the SQL query to poll the database, and return a list of markers on a map of London: http://datanalyst.co.uk/dev/flmap/mapexample7a.php However, I am getting confused regarding the markers, it would seem like my code (which can be found below) is iterating through all of the companies, and then setting just one marker for all points? The code can be found at http://paste.bradleygill.com/index.php?paste_id=348277 I am hoping you can see what I'm doing here. The PHP script is printing HTML / JavaScript code to the page, which includes a foreach loop, which grabs the long lats and puts them into google.maps.LatLng I am just just struggling with the markers - and I cannot see where I've gone wrong! Thanks so much in advance for any help you can provide me! All the best, and Merry Christmas, Michael I am trying to add markers on my google maps which will show the location of all users with the status “active” and on click of the marker it displays the following results from the arrays i am getting over API
login This is my index.php file <!DOCTYPE html> <html> <body> <?php $api_url = 'xxxx'; // please set your x URL $admin_login = "xxxx"; // x administrator login $admin_password = "xxxx"; // administrator password $api = new SplynxAPI($api_url); $api->setVersion(SplynxApi::API_VERSION_2); $isAuthorized = $api->login([ 'auth_type' => SplynxApi::AUTH_TYPE_ADMIN, 'login' => $admin_login, 'password' => $admin_password, ]); if (!$isAuthorized) { exit("Authorization failed!\n"); } $customerApiUrl = "admin/customers/customer/"; print "<pre>"; $result_customers = $api->api_call_get($customerApiUrl); $customers_list = $api->response; if ($result_customers) { } else { print "Fail! Error code: $api->response_code\n"; print_r($api->response); } ?> <table> <thead align="left" style="display: table-header-group"> <tr> <th>CLIENT</th> <th>STATUS</th> <th>GPS</th> </tr> </thead> <tbody> <?php foreach($customers_list as $item) :?> <tr class="item_row"> <td> <?php echo $item['login']; ?></td> <td> <?php echo $item['status']; ?></td> <td> <?php echo $item['gps']; ?></td> </tr> <?php endforeach;?> </tbody> </table> </body> </html> This is the output result |CLIENT|STATUS|GPS| |---|---|---| | user1@example.com| active| -00.269704939193858,00.085300236009065| | user2@example.com| active| -00.29697452399767,00.120804981797505| But now i need this to generate the google maps markers on the map and this is my map below var handleGoogleMapSetting = function() { "use strict"; var mapDefault; var mapOptions = { zoom: 14, center: new google.maps.LatLng(-00.297106, 00.119429), mapTypeId: google.maps.MapTypeId.ROADMAP, disableDefaultUI: true, }; mapDefault = new google.maps.Map(document.getElementById('google-map-default'), mapOptions); $(window).resize(function() { google.maps.event.trigger(mapDefault, "resize"); }); var defaultMapStyles = []; var flatMapStyles = [{"stylers":[{"visibility":"off"}]},{"featureType":"road","stylers":[{"visibility":"on"},{"color":"#ffffff"}]},{"featureType":"road.arterial","stylers":[{"visibility":"on"},{"color":"#fee379"}]},{"featureType":"road.highway","stylers":[{"visibility":"on"},{"color":"#fee379"}]},{"featureType":"landscape","stylers":[{"visibility":"on"},{"color":"#f3f4f4"}]},{"featureType":"water","stylers":[{"visibility":"on"},{"color":"#7fc8ed"}]},{},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#83cead"}]},{"elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"landscape.man_made","elementType":"geometry","stylers":[{"weight":0.9},{"visibility":"off"}]}]; var turquoiseWaterStyles = [{"featureType":"landscape.natural","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#e0efef"}]},{"featureType":"poi","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"hue":"#1900ff"},{"color":"#c0e8e8"}]},{"featureType":"landscape.man_made","elementType":"geometry.fill"},{"featureType":"road","elementType":"geometry","stylers":[{"lightness":100},{"visibility":"simplified"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"water","stylers":[{"color":"#7dcdcd"}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"visibility":"on"},{"lightness":700}]}]; var icyBlueStyles = [{"stylers":[{"hue":"#2c3e50"},{"saturation":250}]},{"featureType":"road","elementType":"geometry","stylers":[{"lightness":50},{"visibility":"simplified"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]}]; var oldDryMudStyles = [{"featureType":"landscape","stylers":[{"hue":"#FFAD00"},{"saturation":50.2},{"lightness":-34.8},{"gamma":1}]},{"featureType":"road.highway","stylers":[{"hue":"#FFAD00"},{"saturation":-19.8},{"lightness":-1.8},{"gamma":1}]},{"featureType":"road.arterial","stylers":[{"hue":"#FFAD00"},{"saturation":72.4},{"lightness":-32.6},{"gamma":1}]},{"featureType":"road.local","stylers":[{"hue":"#FFAD00"},{"saturation":74.4},{"lightness":-18},{"gamma":1}]},{"featureType":"water","stylers":[{"hue":"#00FFA6"},{"saturation":-63.2},{"lightness":38},{"gamma":1}]},{"featureType":"poi","stylers":[{"hue":"#FFC300"},{"saturation":54.2},{"lightness":-14.4},{"gamma":1}]}]; var cobaltStyles = [{"featureType":"all","elementType":"all","stylers":[{"invert_lightness":true},{"saturation":10},{"lightness":10},{"gamma":0.8},{"hue":"#293036"}]},{"featureType":"water","stylers":[{"visibility":"on"},{"color":"#293036"}]}]; var darkRedStyles = [{"featureType":"all","elementType":"all","stylers":[{"invert_lightness":true},{"saturation":10},{"lightness":10},{"gamma":0.8},{"hue":"#000000"}]},{"featureType":"water","stylers":[{"visibility":"on"},{"color":"#293036"}]}]; $('[data-map-theme]').click(function() { var targetTheme = $(this).attr('data-map-theme'); var targetLi = $(this).closest('li'); var targetText = $(this).text(); var inverseContentMode = false; $('#map-theme-selection li').not(targetLi).removeClass('active'); $('#map-theme-text').text(targetText); $(targetLi).addClass('active'); switch(targetTheme) { case 'flat': mapDefault.setOptions({styles: flatMapStyles}); break; case 'turquoise-water': mapDefault.setOptions({styles: turquoiseWaterStyles}); break; case 'icy-COLOR_BLUE': mapDefault.setOptions({styles: icyBlueStyles}); break; case 'cobalt': mapDefault.setOptions({styles: cobaltStyles}); inverseContentMode = true; break; case 'old-dry-mud': mapDefault.setOptions({styles: oldDryMudStyles}); break; case 'dark-red': mapDefault.setOptions({styles: darkRedStyles}); inverseContentMode = true; break; default: mapDefault.setOptions({styles: defaultMapStyles}); break; } if (inverseContentMode === true) { $('#content').addClass('content-inverse-mode'); } else { $('#content').removeClass('content-inverse-mode'); } }); }; var MapGoogle = function () { "use strict"; return { //main function init: function () { handleGoogleMapSetting(); } }; }(); $(document).ready(function() { MapGoogle.init(); });
Hi on my site, i am using an iframe for google maps. When the map comes up it shows markers with information on - part of which is a "clickable" link. Problem is that the url opens in the iframe and i want it to open in a new window coz it goes to a completely different site. I tried putting the target=_blank in different parts of the code, but it just seems to stop everything from working and my google map vanishes ! HERES THE LINE OF CODE THAT I THINK I NEED TO CHANGE } if(v.website != '') { content_string += "<p class='web'>Website: <a href='"+v.website+"'>"+v.website+"</a></p>"; } Can anyone help? - i just want it to open a new window when people click on the hyperlink in the iframe - any suggestions please Brain I have an iFrame with a source location of www.google.com. If I browse to another page on Google.com, I can go to it, but cannot obtain the source of the page. Using JavaScript, I can only return the parent location, www.google.com Is there a way to return the current page URL of an iframe? Another idea is, using PHP, when the iframe makes a request to a new page, is there some way to return the request? Ex: if I browse to google.com/images, can PHP return that the server is trying to request that page? Hello I am curious if it is even possible to get the domain when using iframes/frames? eg. domain2 shows a file from domain1 in an iframe. Can domain1 grab domain name "domian2"? Hello. I'm using a PHP/CGI Upload Script -tesUpload. U can see the uploader at http://www.mintload.com/upload/upload-single.php As you can see, the percentage doesnt reload (its an iframe). On Firefox, if u right click on frame (0%) and select "open frame in new tab" or show only frame, u see it movin' and refreshing. Basically the iframe /fileprog.php calculates the percentage uploaded and refreshes itself to get new percentage every second. The code for upload-single.php is : <?php require_once("upload_helper.php"); $sid = md5(uniqid(rand())); ?> <html> <head> <script language="javascript" type="text/javascript" src="upload.js"></script> <link rel="stylesheet" href="upload.css" type="text/css" media="screen" title="Upload" charset="utf-8" /> <script language="javascript"> function beginUpload(sid) { document.postform.submit(); var pb = document.getElementById("progress"); pb.parentNode.parentNode.style.display='block'; new ProgressTracker(sid,{ progressBar: pb, onFailu function(msg) { Element.hide(pb.parentNode); alert(msg); } }); } </script> </head> <body> <form target="_top" enctype="multipart/form-data" name="postform" action="/cgi-bin/upload.cgi?sid=<?php echo $sid; ?>&target=<?php echo normal_target('receive.php') ?>" method="post"> <div class="inputhead">File 1</div> <input type="file" size="50" name="file_1" /><br/> </form> <div id="progressbox" style="display: none;"><img src="http://www.remit2home.com/remittance/images/mmm_loading.gif" alt="uploading..."> Uploading now... <div class="progresscontainer"><div class="progressbar" id="progress"></div></div> </div> <iframe src="http://mintload.com/upload/fileprog.php?sid=<?php echo $sid; ?>" width=50 height=50 frameborder=0 border=0 allowtransparency="true" ></iframe> uploaded <!--img src="http://www.remit2home.com/remittance/images/mmm_loading.gif" alt="uploading..."--> <!--iframe for percentage--> <p align="right"><input type="image" src="http://mintload.com/images/btn_upload.png" onclick="beginUpload('<?php echo $sid ?>');" alt="Upload" ></p> </body> </html> fileprog.php is alright. I need the percentage in iframe to refresh even when embedded onto upload-single.php Please help Thank you. Is there a way of getting a variable from an iframe to the parent? There are many ways to pass a variable from the parent to the iframe, but I'm not sure if you can pass a variable from the iframe back to the parent. When i refresh/update the iframe, i want the updated/new variable "id_no" to be passed to the parent file (so I can put this value in a form field). I tried the code below, but have been unlucky. Code: [Select] document.getElementById("iframe").this.form.id_no.value; Any ideas? chatframe.php Code: [Select] <? print "<center><iframe src='chatlog.php' name='chatlogframe' width='350' height='400'></iframe>"; print "<br><br>"; print "<iframe src='menu.php' width='350' height='150' frameborder='0'></iframe></center><br><br>"; ?> But actually im want to be as this as the login page is succesfuly direct to form 2 the iframe will be going below chat screen how can i do that? Cant seem to get this to work. The variable does echo the url. What is the correct way to use the variable inside the iframe? $url = $db->loadResult(); <iframe src="<?php echo $url; ?>"width="450" height="259" frameborder="0" allowfullscreen></iframe> This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=319436.0 I'd like to pass a value from a URL to an iframe. This would look as follows: URL: http://www.mysite.com?www.mysite2.com The value (www.mysite2.com) will be an actual web address which should then be inserted into an iframe on www.mysite.com via php. Since I know little to no php, I don't know how the URL has to be structured and what php coding I need to use to include the web address in the iframe. Any suggestions are highly appreciated Hi. I am coding a project, and ability to browse other websites through a frame in this site is central to the project. However, I need to be able to have the href of the frame's current location which I can't do using an iframe. Does anyone know of any techniques using server-side php in which one can view other sites and keep track of the location of the other sides? Thanks, Phil Hi there, i have 3 pages: 1. index.php 2. iframe.php 3. output.php iframe.php is within index.php and in iframe.php there's a form with input fields. Form is including output.php for sending the information. Whenever someone come to index.php, my HTTP_REFERER get's reffer of index.php instead of previously visited page (before my index.php)... how can i fix this? Please help! Im not sure if this is the correct section so sorry for that in advance, i have this URL on my website inside an iframe: http://gorillavid.com/cna/zwzcpyvcfi7j What im wanting to do is somehow either remove all the ads that are shown, or make sure all of the ads are muted and cant make any noise. is this possible? Seany HI im having a problem displaying an image in an iframe or img tag on my php page if i set the source to google it displays fine in the iframe! but if i set the source to a page on my server it doesnt display. It displays in both fire fox and chrome!???? Any help would be greatly appreciated Thanks Sean i need to pass the id called id from the maim page to an iframe, but it failes to send. i'm wondering if anyone knows why it fails. Code: [Select] <iframe src="details.php?ID=<?php echo $ID; ?>" width="700px" height="150px"> </iframe> Illl show you the files and maybe someone can help me figure out whats going on. Lil more about the script When explore.php is opened it selects a random approved link out of the database and posts it within the iframe. Explore.php also calls random.php which has a nice little menubar. When the explore.php is originally clicked on everything works great a random site is selected and ran inside the iframe and the javascript menubar is loaded above the iframe. The issue is i cant get this to happen again. In the menu bar i have a hyperlink that loads Code: [Select] <li><a href="http://localhost/Stumble/explore.php" rel="gotsubmenu[selected]">JavaScript Kit</a></li>But when i click this link it just opens the page behind the iframe instead of in the iframe like it does when the explore.php is originally loaded. So i guess i need a lil help figuring out how i can make the random approved site load in the iframe by clicking a hyper link located in the menubar Thanks for your time Random.php Code: [Select] <?php /** * @author moeller * @copyright 2011 */ ?> <html> <head> <link rel="stylesheet" type="text/css" href="mouseovertabs.css" /> <script src="mouseovertabs.js" type="text/javascript"> /*********************************************** * Mouseover Tabs Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more ***********************************************/ </script> </head> <body> <div id="mytabsmenu" class="tabsmenuclass"> <ul> <li><a href="http://localhost/Stumble/explore.php" rel="gotsubmenu[selected]">JavaScript Kit</a></li> <li><a href="http://www.cssdrive.com" rel="gotsubmenu">CSS Drive</a></li> <li><a href="http://localhost/Stumble/explore.php">No Sub Menu</a></li> </ul> </div> <div id="mysubmenuarea" class="tabsmenucontentclass"> <!--1st link within submenu container should point to the external submenu contents file--> <a href="submenucontents.htm" style="visibility:hidden">Sub Menu contents</a> </div> <script type="text/javascript"> //mouseovertabsmenu.init("tabs_container_id", "submenu_container_id", "bool_hidecontentsmouseout") mouseovertabsmenu.init("mytabsmenu", "mysubmenuarea", true) </script> </body> </html> explore.php Code: [Select] <?php /** * @author Brent Moeller * @copyright 2011 */ include ('functions.php'); db_connect(); $result = mysql_query("SELECT * FROM slinks where approval='1' ORDER BY RAND() LIMIT 1") or die(mysql_error()); ?> <html> <head> <title>DizzyUrl Discovery Engine</title> </head> <frameset rows="80,*" BORDERCOLOR="green" BORDER="3"> <frame src="random.php" name="surfbar" marginwidth="O" marginheight="0" NORESIZE SCROLLING="no" /> <frame src="<?php while ($row = mysql_fetch_array($result)){ print $row["url"];}?> " name="random" marginwidth="O" marginheight="0" noresize scrolling="auto" /> </frameset> <noframes> <body><p>This Browser does not support Frames.</p></body> </noframes> </html> Hello,
Hi,
I have a page that carries through cookies and displays a different image/banner depending on the cookies. The URLs look something like: http://www.website.c...gent=agent-name
I now have a page with an iFrame on displaying the URL: http://www.website.c...gent=agent-name
If I access http://www.website.c...gent=agent-name normally, they cookies carry through and the banner shows, but it doesn't if I access it through the iFrame.
Is there a way of carrying the cookies into the iFrame?
Also the URL that the iFrame is on is different to the content of the page inside the iFrame.
Thanks!
|