|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I am using dreamweaver and am new to php.
I have a field Map_String containing http://maps.google.com/staticmap?cen...cP6-YoywNxF44w I can extract this data and display in a text box : mysql_select_db($database_mapping, $mapping); $query_Maprecord = "SELECT Map_String FROM gps_data"; $Maprecord = mysql_query($query_Maprecord, $mapping) or die(mysql_error()); $row_Maprecord = mysql_fetch_assoc($Maprecord); $totalRows_Maprecord = mysql_num_rows($Maprecord); <form id="form1" name="form1" method="post" action=""> <label>test <input value="<?php echo $row_Maprecord['Map_String']; ?>" type="text" name="textfield" /> </label> </form> I need convert the above into a link but cannot work out the correct syntax. Any appreciated SteveW |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
<a href="<?php echo $row_Maprecord['Map_String']; ?>">Map</a>
-- Murray --- ICQ 71997575 Adobe Community Expert (If you *MUST* email me, don't LAUGH when you do so!) ================== http://www.projectseven.com/go - DW FAQs, Tutorials & Resources http://www.dwfaq.com - DW FAQs, Tutorials & Resources ================== "SteveW" <Stevewarby@btinternet.com> wrote in message news:g1vfse$jhm$1@forums.macromedia.com... >I am using dreamweaver and am new to php. > > I have a field Map_String containing > http://maps.google.com/staticmap?cen...cP6-YoywNxF44w > I can extract this data and display in a text box : > > mysql_select_db($database_mapping, $mapping); > $query_Maprecord = "SELECT Map_String FROM gps_data"; > $Maprecord = mysql_query($query_Maprecord, $mapping) or > die(mysql_error()); > $row_Maprecord = mysql_fetch_assoc($Maprecord); > $totalRows_Maprecord = mysql_num_rows($Maprecord); > > > <form id="form1" name="form1" method="post" action=""> > <label>test > > <input value="<?php echo $row_Maprecord['Map_String']; ?>" type="text" > name="textfield" /> > </label> > </form> > > I need convert the above into a link but cannot work out the correct > syntax. > > Any appreciated > > SteveW > > > |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
I have added the code when run locally the link takes me to the google page
but I get error Error Bad Request Your client has issued a malformed or illegal request. If I cut and paste the link from IE and paste into a new window I get the google map as expected. The site is at www.iw10.co.uk. My Code as follows: <?php require_once('Connections/Mapping.php'); ?> <?php require_once('../Connections/Mapping.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } mysql_select_db($database_Mapping, $Mapping); $query_Today = "SELECT gps_data.`Lat`, gps_data.Lon FROM gps_data WHERE gps_data.`Date` = CURDATE()"; $Today = mysql_query($query_Today, $Mapping) or die(mysql_error()); $row_Today = mysql_fetch_assoc($Today); $totalRows_Today = mysql_num_rows($Today); mysql_select_db($database_Mapping, $Mapping); $query_Latest = "SELECT gps_data.`Lat`, gps_data.Lon, gps_data.User_name, gps_data.Time,gps_data.Map_String FROM gps_data ORDER BY num desc LIMIT 1 "; $Latest = mysql_query($query_Latest, $Mapping) or die(mysql_error()); $row_Latest = mysql_fetch_assoc($Latest); $totalRows_Latest = mysql_num_rows($Latest); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <script type="text/javascript"> /*wagmp*/ <?php include("google_javascript/wagmp_map_7.php"); ?> </script> <script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAATotG25YVOf4zCWnbvczg 2hTcEsAHU3LXVmOGC0eZSg7FL02XvRS3LK1xQLb_4dVJ6v3Kby 31TMMAbg">/*wagmp*/</script> <script type="text/javascript"> /*wagmp*/ <?php include("google_javascript/wagmp_map_10.php"); ?> </script> </head> <body> <p><img src="images/iw10 logo.png" width="210" height="96" /> </p> User: <?php echo $row_Latest['User_name']; ?> <p>Time: <?php echo $row_Latest['Time']; ?></p> <p> <?php echo $row_Latest['Map_String']; ?></p> <p><a href="<?php echo $row_Latest['Map_String']; ?>">Map</a> </p> <p>iW10/Research and Development: Server Testing </p> <p> <a href="\Demo_big.php"></a>iw10: All location and alerts-24hours (total := <?php echo $totalRows_Today ?> ) </p> <p> </p> <p></p> <script type="text/javascript" src="google_javascript/wagmp_maps.js">/*wagmp*/</script> </body> </html> <?php mysql_free_result($Today); mysql_free_result($Latest); ?> "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message news:g1vlal$onv$1@forums.macromedia.com... > <a href="<?php echo $row_Maprecord['Map_String']; ?>">Map</a> > > -- > Murray --- ICQ 71997575 > Adobe Community Expert > (If you *MUST* email me, don't LAUGH when you do so!) > ================== > http://www.projectseven.com/go - DW FAQs, Tutorials & Resources > http://www.dwfaq.com - DW FAQs, Tutorials & Resources > ================== > > > "SteveW" <Stevewarby@btinternet.com> wrote in message > news:g1vfse$jhm$1@forums.macromedia.com... >>I am using dreamweaver and am new to php. >> >> I have a field Map_String containing >> http://maps.google.com/staticmap?cen...cP6-YoywNxF44w >> I can extract this data and display in a text box : >> >> mysql_select_db($database_mapping, $mapping); >> $query_Maprecord = "SELECT Map_String FROM gps_data"; >> $Maprecord = mysql_query($query_Maprecord, $mapping) or >> die(mysql_error()); >> $row_Maprecord = mysql_fetch_assoc($Maprecord); >> $totalRows_Maprecord = mysql_num_rows($Maprecord); >> >> >> <form id="form1" name="form1" method="post" action=""> >> <label>test >> >> <input value="<?php echo $row_Maprecord['Map_String']; ?>" type="text" >> name="textfield" /> >> </label> >> </form> >> >> I need convert the above into a link but cannot work out the correct >> syntax. >> >> Any appreciated >> >> SteveW >> >> >> > |
|
![]() |
| Outils de la discussion | |
|
|