There are several issues with your code.
First, you cannot simply call "$_REQUEST[Email]"
inside a string like that. It will not get the value of the variable because there are brackets envolved. You have to use "{$_REQUEST[Email]}"
instead.
Second, sinse the keys Email
and Nombre
are strings, its adequate that you properly declare them as such using "{$_REQUEST['Email']}"
.
In addition, its extremely dangerous to get values that come from the client-side and drop them in your SQL query directly with no filtering. You are exposing your site to SQL injection.
All and any data coming from client should be properly escaped with mysql_real_escape_string()
before inserting it in your SQL query.
That being said, your code should be:
$nombre = mysql_real_escape_string($_REQUEST['Nombre']);
$email = mysql_real_escape_string($_REQUEST['Email']);
$pw = mysql_real_escape_string($_REQUEST['PW']);
mysql_query("INSERT INTO RegUsuarios (Nombre,Email,PW) values
('{$nombre}','{$email}','{$pw}')",$Con) or die('Problema insertando datos');
It is also a bad practice to store plain text passwords, and mysql_* functions are deprecated and will be soon removed from PHP. Consider storing the passwords as sha1()
hashes, and migrate your code to use MySQLi.