pfernandez59
03-26-2005, 11:28 PM
I'm newbee in flash mx and I've a big problem with loadvars and php. I've been using a script from toolbox which consists in one .fla file, one .as file and 4 .php files (insert, update, delete and gettabledata). The fla file, once compiled into swf, is a movie to edit-delete-insert records in a mysql database. The problem is: Once appended a new record in the database, the fields are stored with strange symbols like P%C3%A9rez%20G%C3%B3mez instead of Pérez Gómez. ¿IS IT POSSIBLE TO STORE RECORDS IN THE DATABASE WITHOUT THIS "IMPOSSIBLE MISSION" READING?
If it helps, here is the php code in insertContact.php:
<?php
mysql_connect("host","user","pass");
mysql_select_db("dbname");
$success = 1;
$ins_str = "INSERT INTO contacts VALUES (NULL, '".$HTTP_POST_VARS['contactType']."', '".$HTTP_POST_VARS['dorsal']."', '".$HTTP_POST_VARS['apellidos']."', '".$HTTP_POST_VARS['nombre']."', '".$HTTP_POST_VARS['domicilio']."', '".$HTTP_POST_VARS['cpostal']."', '".$HTTP_POST_VARS['poblacion']."', '".$HTTP_POST_VARS['telefono']."', '".$HTTP_POST_VARS['movil']."', '".$HTTP_POST_VARS['email']."', '".$HTTP_POST_VARS['fecha_nac']."', '".$HTTP_POST_VARS['altura']."', '".$HTTP_POST_VARS['posicion']."', '".$HTTP_POST_VARS['picFile']."')";
//echo $ins_str;
if (!mysql_query ($ins_str)) {
$success = 0;
$msg = 'Problem saving records to the database';
} else {
$msg = 'Record was saved successfully. Refreshing display...';
}
echo '&success='.$success.'&msg='.$msg.'&';
?>
THANK YOU VERY MUCH IN ADVANCE!!!! GREAT FORUM!!!!!
If it helps, here is the php code in insertContact.php:
<?php
mysql_connect("host","user","pass");
mysql_select_db("dbname");
$success = 1;
$ins_str = "INSERT INTO contacts VALUES (NULL, '".$HTTP_POST_VARS['contactType']."', '".$HTTP_POST_VARS['dorsal']."', '".$HTTP_POST_VARS['apellidos']."', '".$HTTP_POST_VARS['nombre']."', '".$HTTP_POST_VARS['domicilio']."', '".$HTTP_POST_VARS['cpostal']."', '".$HTTP_POST_VARS['poblacion']."', '".$HTTP_POST_VARS['telefono']."', '".$HTTP_POST_VARS['movil']."', '".$HTTP_POST_VARS['email']."', '".$HTTP_POST_VARS['fecha_nac']."', '".$HTTP_POST_VARS['altura']."', '".$HTTP_POST_VARS['posicion']."', '".$HTTP_POST_VARS['picFile']."')";
//echo $ins_str;
if (!mysql_query ($ins_str)) {
$success = 0;
$msg = 'Problem saving records to the database';
} else {
$msg = 'Record was saved successfully. Refreshing display...';
}
echo '&success='.$success.'&msg='.$msg.'&';
?>
THANK YOU VERY MUCH IN ADVANCE!!!! GREAT FORUM!!!!!