Comment intégré des variable php dans js
marwenebhar
Messages postés
45
Date d'inscription
Statut
Membre
Dernière intervention
-
Autumn`Tears Messages postés 1054 Date d'inscription Statut Membre Dernière intervention -
Autumn`Tears Messages postés 1054 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
comment je peut integrè des variable php dans un script js
voila le code qui je veut intégré le deux variable a et b transmis par une autre page php et l'utilisera pour pointer le coordonner dans le script java script merci
<html>
<head>
<?PHP
$a=$_POST['corx'];
$b=$_POST['cory'];
?>
<link rel="icon" type="image/png" href="wifi-icone-4455-128.png" />
<link rel="Stylesheet" type="text/css" href="css/Layout.css" />
<!-- add a META element with the charset attribute set to "utf-8", as follows
Your page must use UTF-8 encoding to create some elements of the map -->
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<!-- Reference to the map control -->
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<!-- A sensor value is required. True indicates that your application is using a sensor
(such as a GPS locator) to determine the user's location. False indicates that you are not-->
<script type="text/javascript">
var map;
$a=35.4444082;
$b=10.8844941;
function initialize()
{
var myLatlng = new google.maps.LatLng($a,$b);
// sets the center of the map to the varible "LatLong" that contains the coordinates
var myOptions =
{
zoom: 6,
// Zoom level for initial map. Valild vaues range form 0 to 20
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
// sets the type of map to be displayed
// HYBRID - displays a transparent layer of major streets on satellite images
// ROADMAP - displays a normal street map
// SATELLITE - displays satellite images
// TERRAIN - displays maps with physical features such as terrain
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var marker = new google.maps.Marker
(
{
position: new google.maps.LatLng($a,$b),
// sent the geographic position for the marker
map: map,
// puts the marker on the specified map
title:"locatisation trouver",
// text that will display when the mouse cursor hovers over the marker
icon: 'mm.png'
// location of image file that will be used as a marker
}
)
;
}
</script>
</head>
comment je peut integrè des variable php dans un script js
voila le code qui je veut intégré le deux variable a et b transmis par une autre page php et l'utilisera pour pointer le coordonner dans le script java script merci
<html>
<head>
<?PHP
$a=$_POST['corx'];
$b=$_POST['cory'];
?>
<link rel="icon" type="image/png" href="wifi-icone-4455-128.png" />
<link rel="Stylesheet" type="text/css" href="css/Layout.css" />
<!-- add a META element with the charset attribute set to "utf-8", as follows
Your page must use UTF-8 encoding to create some elements of the map -->
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<!-- Reference to the map control -->
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<!-- A sensor value is required. True indicates that your application is using a sensor
(such as a GPS locator) to determine the user's location. False indicates that you are not-->
<script type="text/javascript">
var map;
$a=35.4444082;
$b=10.8844941;
function initialize()
{
var myLatlng = new google.maps.LatLng($a,$b);
// sets the center of the map to the varible "LatLong" that contains the coordinates
var myOptions =
{
zoom: 6,
// Zoom level for initial map. Valild vaues range form 0 to 20
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
// sets the type of map to be displayed
// HYBRID - displays a transparent layer of major streets on satellite images
// ROADMAP - displays a normal street map
// SATELLITE - displays satellite images
// TERRAIN - displays maps with physical features such as terrain
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var marker = new google.maps.Marker
(
{
position: new google.maps.LatLng($a,$b),
// sent the geographic position for the marker
map: map,
// puts the marker on the specified map
title:"locatisation trouver",
// text that will display when the mouse cursor hovers over the marker
icon: 'mm.png'
// location of image file that will be used as a marker
}
)
;
}
</script>
</head>
A voir également:
- Comment intégré des variable php dans js
- Que veut dire achat intégré - Guide
- Easy php - Télécharger - Divers Web & Internet
- Tv lg tnt intégré problème - Guide
- Intégrer une vidéo dans un powerpoint - Guide
- Expert php pinterest - Télécharger - Langages