PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Graphisme & Infographie > macromedia.dreamweaver > Create a link from database
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Create a link from database

Réponse
 
LinkBack Outils de la discussion
Vieux 02/06/2008, 01h46   #1
SteveW
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Create a link from database

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



  Réponse avec citation
Vieux 02/06/2008, 03h18   #2
Murray *ACE*
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Create a link from database

<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
>
>
>


  Réponse avec citation
Vieux 02/06/2008, 03h59   #3
SteveW
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Create a link from database

I have added the code when run locally the link takes me to the google page
but I get error

Google
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>&nbsp;<?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&nbsp; </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
>>
>>
>>

>



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 01h16.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,16019 seconds with 11 queries