Jump to content

Codey

New Members
  • Posts

    5
  • Joined

  • Last visited

Codey's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you very much for the help !
  2. Thank you for the reply, I have php error checking "on", but still code does not work, have checked the quotes you mentioned but same problem persist, no error message is shown everything ok except that data is not saved in the db.
  3. Hello I am new to PHP and am working on an exercise but is not working, the problem is that is not inserting the data in to mysql database. When enter the user and password in the html page runs and give no problems, get no errors. In MySQL one table created with: ID, NOMBRE, PW Linux OS OpenSuse 13.1 / localhost Apache 2.4.6 Database Server version 5.5.33-MariaDB Database client version mysqlnd 5.0.10 PHPMyAdmin 4.1.14 Attached is a screenshot of the PHPMyAdmin table. This is my index dot php <!DOCTYPE> <html> <head> <title> Insertar Nombre Password </title> </head> <body> <form action="insertar.php" method="post" name="form"> <input type="text" name="nombre" /><br /><br /> <input type="password" name="pw" /><br /><br /> <input type="submit" value="insertar datos" /> </form> </body> </html> insertar dot php <?php //Include another script in this one. include("conexion.php"); if(isset($_POST['nombre']) && !empty($_POST['nombre']) && isset($_POST['pw']) && !empty($_POST['pw'])) { //Connect to the database $con = mysql_connect($host,$user,$pw)or die("problemas al conectar"); mysql_select_db($db,$con)or die("problemas al conectar la bd"); mysql_query("INSERT INTO CodigoF (NOMBRE,PW) VALUES ('$_POST[nombre]','$_POST[pw]')",$con); echo "datos insertados"; } else { echo "problemas al insertar datos"; } ?> conexion dot php <?php $host = "localhost"; $user = "root"; $pw = "Fafa1669"; $db = "CodigoFacilito"; ?> Hope some one can guide me in the right direction, thank you.
  4. Thank you for the help, problem solved !
  5. Hello Hope some one can guide me in the right direction, am working on a simple PHP Calculator. Been trying to find the problem for quite some hours all I get is a blank page, and have not been able to spot the issue, here is the code: <html> <head> <title></title> </head> <body> <?php $operacion = $_POST['lista']; if (isset($_POST['c1']) && !empty($_POST['c1']) && isset($_POST['c2']) && !empty($_POST['c2']) && isset($_POST['c3']) && !empty($_POST['c3']) echo "El resultado es"; else { echo "debes insertar todos los campos"; } switch($operacion) { case sumar: echo $_POST['c1'] + $_POST['c2'] + $_POST['c3']; break; case restar: echo $_POST['c1'] - $_POST['c2'] - $_POST['c3']; break; case multiplicar: echo $_POST['c1'] * $_POST['c2'] * $_POST['c3']; break; case dividir: echo $_POST['c1'] / $_POST['c2'] / $_POST['c3']; break; default: "no se ha podido realizar la operacion"; } ?> </body> </html> Any help would be appreciated, thank you.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.