0

I'm trying to put some values into DB with PHP. I'm using polymer dart . is this code wrong? When i used it only put $calle but $Latitud, $longitud not

html

<form action="conexion.php" method="post">
<input type=hidden name="latitud" value="{{latitud}}">
<input type=hidden name="longitud" value="{{longitud}}">
<input type="submit" value="submit">
</form>

php

<?php 
$hostname_dasavi_codes = "xxx"; 
$database_dasavi_codes = "xxx"; 
$username_dasavi_codes = "xxx"; 
$password_dasavi_codes = "xxx"; 
$dasavi_codes = mysql_connect($hostname_dasavi_codes, $username_dasavi_codes, $password_dasavi_codes) or trigger_error(mysql_error(),E_USER_ERROR);  
$calle="rolf";
$lat=$_POST["latitud"];
$lon=$_POST["longitud"];
mysql_select_db($database_dasavi_codes, $dasavi_codes); 
$query_java = "INSERT INTO ovnis (latitud,longitud,calle) VALUES ('$lat','$lon','$calle')"; 
$result=mysql_query($query_java);
?> 

dart

...
  @published String latitud;
  @published String longitud;
...
Geoposition startPosition;
String calle;
window.navigator.geolocation.getCurrentPosition()
.then((Geoposition position) {
  startPosition = position;
  latitud="${startPosition.coords.latitude}";
  longitud="${startPosition.coords.longitude}";

I don't know if I can use PHP and dart together. Thanks you very much!

dasavi
  • 25
  • 4

2 Answers2

0

You can use Dart on client side whatever the language you choose on server side.

Alexandre Ardhuin
  • 71,959
  • 15
  • 151
  • 132
0

Of course you can use Dart on the client and PHP on the server. They both don't even have to know of each others implementation details.

Some generic information about processing forms in Dart. - Forms, HTTP servers, and Polymer with Dart (might be somewhat outdated)

This questions have some example code how to work with Polymer, and forms

If you need more detailed information I suggest to ask a new more specific question.

Community
  • 1
  • 1
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567