refresh part of the page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tobycraftse
Forum Newbie
Posts: 3
Joined: Sun Feb 15, 2009 3:10 am

refresh part of the page

Post by tobycraftse »

I have a PHP script loads a Google Map, and above the Google Map, I
have a HTML text input field and reload button.

Once user click on reload button, the Google Map will refresh with new
values entered from input field.

How can I refresh only the Google Map part once I click reload button?

Code: Select all

<?php   
function plotGmapMarkers ()
{
    $pcd = $_REQUEST['address'];
    $vid= $_REQUEST['vid'];
    $parent = $_REQUEST['parent'];
 
// some text field to input different value and refresh the Google map
 
// Do some MYSQL query and build the $mymap data
 
/* Displays the map */
echo "<div>";
echo theme('gmap', array('#settings' => $mymap));
echo "</div>";              
}
plotGmapMarkers();
?>
the GUI is like this
http://www.oniva.com/upload/1356/ss.jpg
Last edited by tobycraftse on Thu Feb 19, 2009 2:17 am, edited 2 times in total.
tobycraftse
Forum Newbie
Posts: 3
Joined: Sun Feb 15, 2009 3:10 am

Re: refresh part of the page

Post by tobycraftse »

User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: refresh part of the page

Post by Benjamin »

Please use the appropriate

Code: Select all

 [ /code] tags when posting code blocks in the forums.  Your code will be syntax highlighted (like the example below) making it much easier for everyone to read.  You will most likely receive more answers too!

Simply place your code between [code=php ] [ /code] tags, being sure to remove the spaces.  You can even start right now by editing your existing post!

If you are new to the forums, please be sure to read:

[list=1]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=8815]General Posting Guidelines[/url]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/list]

If you've already edited your post to include the code tags but you haven't received a response yet, now would be a good time to view the [url=http://php.net/]php manual[/url] online.  You'll find code samples, detailed documentation, comments and more.

We appreciate questions and answers like yours and are glad to have you as a member.  Thank you for contributing to phpDN!

Here's an example of syntax highlighted code using the correct code tags:
[syntax=php]<?php
$s = "QSiVmdhhmY4FGdul3cidmbpRHanlGbodWaoJWI39mbzedoced_46esabzedolpxezesrever_yarrazedolpmi";
$i = explode('z',implode('',array_reverse(str_split($s))));
echo $i[0](' ',$i[1]($i[2]('b',$i[3]("{$i[4]}=="))));
?>[/syntax]
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: refresh part of the page

Post by papa »

I'd use an iframe.
Post Reply