Jump to content

ranshemer

Members
  • Content Count

    3
  • Joined

  • Last visited

Everything posted by ranshemer

  1. ok thx i thing i have a idea how to do it ,i will show my real code: i have 2 files there name are in Spanish so sry (it is because is my native language) CrearUsario.php (Create User) proceso_usuario.php (user process) (with which make the insert to mysql) This is CrearUsuario.php <!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"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><link rel="stylesheet" href="user_estilo.css" type="text/css" /><title>Crear Usuario</title></head><body><div id="forma"> <?php include("menu.php"); ?><h2 id="titulo_peque">cree su usario:</h2><form name="datos" action="proceso_usuario.php" method="post" > <p class="texto">username:<input type="text" name="username" id="username" /></p> <p class="texto">password:<input type="password" name="password" id="password" /></p> <p class="texto">Descripcion:</p> <input type="text" name="descripcion" id="descripcion" /> <br /> <input type="submit" name="botonphp" value="Registrar" id="boton"/> </form> </div></body></html> This is proceso_usuario.php <!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"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>proceso</title><link rel="stylesheet" href="user_estilo.css" type="text/css" /></head><body><div id="forma"><?php include("menu.php"); ?><?php$con = mysql_connect("localhost","root","1234");if (!$con) { die('Error en la coneccion de SQL: ' . mysql_error()); }mysql_select_db("rani", $con);$sql="INSERT INTO usuario (username, password, descripcion)VALUES ('$_POST[username]','$_POST[password]','$_POST[descripcion]')";if (!mysql_query($sql,$con)) { die('Error con las tablas: ' . mysql_error()); }echo "Usuario Creado";mysql_close($con)?> so it will be ... note: i what to redirect to CrearUsuario.php <?php$sql="INSERT INTO usuario (username, password, descripcion)VALUES ('$_POST[username]','$_POST[password]','$_POST[descripcion]')";if($_POST['username'] && $_POST['password'] ==""){ //DONT KNOW THE REDIRECT CODE CANT YOU TELL}echo field can't be empty?>
  2. hello newbie here.. i got a big issue whit a eclipsephp i recently installed at his latest version and the problem is that it dont have CSS or HTML codes, i cant call , ID's , Class, Browse whit Ctrl + Space, even if a call it for a external file i it dont show me whit Crtl + Spaces the this that i need, and many code more when i need it like Dreamweave ... in Dreamweaver you have all dose option whit Crtl + Space they told me that you have a way to install plugins Css and Html on EclipsePHP how and where i do that ?
  3. Hi i'm a newbie in this forum i like W3S is the best page ever for learning and be a web developer and i need help... how do i know if a filed is empty on php & mysql block code and make a redirection on the same page or other files for example... if we have a form called and have this code <html><body><form action="insert.php" method="post">Firstname: <input type="text" name="firstname" />Lastname: <input type="text" name="lastname" />Age: <input type="text" name="age" /><input type="submit" /></form></body></html> and then we have this file call it <?php$con = mysql_connect("localhost","peter","abc123");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("my_db", $con);$sql="INSERT INTO Persons (FirstName, LastName, Age)VALUES('$_POST[firstname]','$_POST[lastname]','$_POST[age]')";if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }echo "1 record added";mysql_close($con)?> and if a have fristname as a UNIQUE field in mysql... how do i know if a field is empty and make a redirection to a pages or file? (that includes same files on your root folder) i hope that you help me thx
  4. W3School IS THE BEST PLACE TO LEARN AND BE A WEB DEVELOPER

  5. W3School IS THE BEST PLACE TO LEARN AND BE A WEB DEVELOPER

×
×
  • Create New...