Jump to content

Anyone can help?


MsAngel

Recommended Posts

Well my code basically is a map indicate 2 points to show where you are.

when u manally input the number in the 2boxes Longitude & Latitude it's will display on the map and hv a point indicate there. and now i got to do is the 2 number i manaully type in which is the value, it's must display from the webpage. yup pls help me thks!

 

<html>
<head>

<?php
$posLat = $_POST["lat"];
$posLon = $_POST["lon"];
if( $posLat==0 )    $posLat=1.40335;
if( $posLon==0 )    $posLon=103.7913;

$target    = "Flash/flashimage.php?latitude=" . $posLat . "&longitude=" . $posLon . "";
?>

<form action="astarFlash.php" method="post">
<?php


print 'Manual Input<br>';
print 'Longitude: <input name="lon" type="text" value=' . $posLon . ' >';
print 'Latitude: <input name="lat" type="text" value=' . $posLat . ' >';
?>
<input type="submit" />
</form>



<form action="astarFlash.php" method="post">
<?php


function readDatabase()
    {
        $numargs = func_num_args();
        $arg_list = func_get_args();

        $strDataItems = "";
        $conn = @mysql_connect("localhost", "root", "");


        if (!$conn)
            die("<p>Error connecting to MySQL: <i>" . mysql_error() . "</i></p>");
    //    echo("<br>"."Connected to Database Successfully");

        if (!@mysql_select_db( $arg_list[0], $conn ))
            die("Error selecting astar database: <i>" . mysql_error() . "</i></p>");
    //    echo(" | Selected astar database successfully");

        $queryStr = "select * from " . $arg_list[1];
        $result = mysql_query( $queryStr );

        while  ($row = mysql_fetch_assoc($result)){
            $strDataItems = $strDataItems."<br>";

            for ($colno = 0; $colno < ($numargs-2); $colno++) {
                $strDataItems = $strDataItems.$row[$arg_list[$colno+2]]." ";
            }

}


        mysql_close ($conn);
    //    echo("  Disconnected");

        return $strDataItems;
    }

$sDataItems = readDatabase("astar", "number", "Longitude", "Latitude");
echo "<br>Longitude             "."Latitude";    echo $sDataItems;


print '<br><br>Read Database<br>'; //asign values from databasse to $posLon, $posLat
print 'Longitude: ' . $posLon;
print 'Latitude: ' . $posLat;

?>


<form action="astarflash.php" method="post">
<input type="submit" value="[color=red]next value[/color]" />


</form>

</head>
<body>

<embed src=<?= $target ?> quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
    type="application/x-shockwave-flash" width="1000" height="750">
</embed>

</body>
</html>

 

(edited by kenrbnsn to add


tags)

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.