Re: Problems with Spanish characters
Posted by: Enrique Finot
Date: July 30, 2010 06:11AM

Thank you for your attention,

Here is the storage php file's code:
--------------
<?php require_once('Connections/Registro.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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;
}
}

// *** Redirect if username exists
$MM_flag="MM_insert";
if (isset($_POST[$MM_flag])) {
$MM_dupKeyRedirect="usuarioexistente.html";
$loginUsername = $_POST['emailusuario'];
$LoginRS__query = sprintf("SELECT emailusuario FROM Registro_Usuarios WHERE emailusuario=%s", GetSQLValueString($loginUsername, "text"));
mysql_select_db($database_Registro, $Registro);
$LoginRS=mysql_query($LoginRS__query, $Registro) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);

//if there is a row in the database, the username was found - can not add the requested username
if($loginFoundUser){
$MM_qsChar = "?";
//append the username to the redirect page
if (substr_count($MM_dupKeyRedirect,"?") >=1) $MM_qsChar = "&";
$MM_dupKeyRedirect = $MM_dupKeyRedirect . $MM_qsChar ."requsername=".$loginUsername;
header ("Location: $MM_dupKeyRedirect");
exit;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) {
$insertSQL = sprintf("INSERT INTO Registro_Usuarios (emailusuario, nombreusuario, apellidousuario, paisusuario, tullave) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['emailusuario'], "text"),
GetSQLValueString($_POST['nombreusuario'], "text"),
GetSQLValueString($_POST['apellidousuario'], "text"),
GetSQLValueString($_POST['paisusuario'], "text"),
GetSQLValueString($_POST['tullave'], "int"));

mysql_select_db($database_Registro, $Registro);
$Result1 = mysql_query($insertSQL, $Registro) or die(mysql_error());

$insertGoTo = "bienvenido.html";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%>
<!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"><;!-- InstanceBegin template="/Templates/masinformacion.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Registro Usuarios</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<!-- InstanceEndEditable -->
<link href="oneColLiqCtrHdr.css" rel="stylesheet" type="text/css" />
</head>

<body class="oneColLiqCtrHdr">

<div class="oneColLiqCtrHdr" id="container">
<div id="header"><a href="http://www.tullaveausa.com"><img src="images/logo azul.jpg" width="323" height="77" alt="tu-llave-a-USA" /></a>
<!-- end #header -->
</div>
<!-- InstanceBeginEditable name="Contenido" -->
<div id="mainContent">
<h2>Llenando este formulario obtienes tu-llave-a-USA</h2>
<p><strong>tu-llave-a-USA</strong> te abrirá infinidad de puertas para acceder a múltiples beneficios.</p>
<p>El registro es gratis y no te obliga a utilizar ninguno de los servicios que te ofrecemos.<span id="sprytextfield1"><span class="textfieldRequiredMsg"> </span></span></p>
<form action="<?php echo $editFormAction; ?>" method="POST" name="form2" id="form2">
<table align="center">
<tr valign="baseline">
<td width="243" align="left" nowrap="nowrap">Correo Electrónico (e-mail)*: </td>
<td width="326"><span id="sprytextfield2">
<input name="emailusuario" type="text" size="25" maxlength="25" />
<span class="textfieldRequiredMsg">Debe llenarse</span><span class="textfieldInvalidFormatMsg">Formato incorrecto</span><span class="textfieldMinCharsMsg">Mínimo 5 caracteres</span><span class="textfieldMaxCharsMsg">Máximo 25 caracteres</span></span></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left">Nombre(s)*: </td>
<td><span id="sprytextfield3">
<input name="nombreusuario" type="text" value="" size="25" maxlength="25" />
<span class="textfieldRequiredMsg">Debe llenarse</span><span class="textfieldMinCharsMsg">Mínimo 1 carácter</span><span class="textfieldMaxCharsMsg">Máximo 25 caracteres</span></span></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left">Apellido(s)*: </td>
<td><span id="sprytextfield4">
<input name="apellidousuario" type="text" value="" size="25" maxlength="25" />
<span class="textfieldRequiredMsg">Debe llenarse</span><span class="textfieldMinCharsMsg">Mínimo 1 carácter</span><span class="textfieldMaxCharsMsg">Máximo 25 caracteres</span></span></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left">País de Residencia*: </td>
<td><span id="sprytextfield5">
<input name="paisusuario" type="text" size="25" maxlength="25" />
<span class="textfieldRequiredMsg">Debe llenarse</span><span class="textfieldMinCharsMsg">Mínimo 1 carácter</span><span class="textfieldMaxCharsMsg">Máximo 25 caracteres</span></span></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left">Elige tu llave (un número de 4 cifras)*:</td>
<td align="left"><span id="sprytextfield6">
<input name="tullave" type="text" id="tullave" size="4" maxlength="4" />
<span class="textfieldRequiredMsg">Debe llenarse</span><span class="textfieldMinCharsMsg">Mínimo 4 caracteres</span><span class="textfieldMaxCharsMsg">Máximo 4 caracteres</span><span class="textfieldInvalidFormatMsg">Formato incorrecto</span></span></td>
</tr>
</table>
<table width="74" align="center">
<tr>
<th align="center" scope="col"><input type="submit" value="Aceptar" /></th>
</tr>
</table>
<p>
<input type="hidden" name="MM_insert" value="form2" />
</p>
</form>
<p>* Todos los campos deben llenarse</p>
<p><strong>IMPORTANTE</strong>: tu-llave-a-USA utiliza el email como identificador de usuario, por lo no que puedes abrir más de una cuenta con el mismo email.</p>
<p><a href="index.html"> Volver a la página de inicio sin registrarte</a></p>
<!-- end #mainContent -->
</div>
<script type="text/javascript">
<!--
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "email", {minChars:5, maxChars:25});
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "none", {minChars:1, maxChars:25});
var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "none", {minChars:1, maxChars:25});
var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "none", {minChars:1, maxChars:25});
var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6", "integer", {minChars:4, maxChars:4});
//-->
</script>
<!-- InstanceEndEditable -->
<div id="footer">
<!-- end #footer -->
</div>
<!-- end #container --></div>
</body>
<!-- InstanceEnd --></html>
------------------

MyphpAdmin accept to fill records with special spanish characters but in the browser's view appears as a question mark inside a black diamond.

Options: ReplyQuote


Subject
Views
Written By
Posted
6344
July 15, 2010 09:15AM
Re: Problems with Spanish characters
3455
July 30, 2010 06:11AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.