1
I’m now entering the programming part with mysql
and php
, and I’m doubtful, on the part of calling the database.vcs can help me out?
The codes I wrote:
<html>
<head>
<title> sistema de cadastro</title>
</head>
<body>
<form method="get="action="cadastrando.php">
nome: <input type="text" name="name"/> <b></b>
sobre nome: <input type="text" name="sobrenome"/><b> </b>
pais: <input type="text" name="pais"/> <b></b>
estado:<input type="text" name="estado"/> <b></b>
idade: <input type="text" name="cidade"/> <b></b>
e-mail: <input type="text" name="email"/> <b></b>
senha: <input type="password" name="senha"/> <b></b>
<input type="submit" value=""/>
</form>
</body>
</html>
///////////////////////////////////////////////////////////////////////////
<html>
<head>
<title> cadastramento</html>
</head>
<body>
<?php
$host ="localhost";
$user = "root";
$pass = "";
$banco= "cadastramento";
$conexao = mysql_connect($host,$user, $pass) or die(mysql_error());
mysql_select_db($banco) or die(mysql_error());
?>
<?php
$nome=$_post['NOME'];
$sobrenome=$_post['SOBRENOME'];
$pais=$_post['PAIS'];
$estado=$_post['ESTADO'];
$cidade=$_post['CIDADE'];
$email=$_post['EMAIL'];
$senha=$_post['SENHA'];
$sql = mysql_query("INSERT INTO usaname(NOME,SOBRENOME,PAIS,ESTADO,CIDADE,EMAIL,SENHA) values('$NOME','$SOBRENOME','$PAIS','$ESTADO','$CIDADE','$EMAIL','$SENHA')");
?>
</body>
</html>
Friend, your question is very vague and half meaningless. Post the codes you already have and try to explain better what you need.
– mauricio caserta
I would recommend separating the view layer with the layer that connects to the database for better organization.
– Giancarlo Abel Giulian
The best tip for a beginner me php, DO NOT use the mysql_* functions, prefer mysqli or Pdo.
– rray