note 106947 deleted from features.connection-handling by tularis
| From: | tularis@php.net | Date: | Thu, 22 Dec 2011 20:37:40 +0000 |
| Subject: | note 106947 deleted from features.connection-handling by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-185215@lists.php.net to get a copy of this message | ||
Note Submitter: kuky
Reason: spam
----
this is hoe you canconnect and add elements in a table
<?php
include("conectare.php");
//echo "$_POST[nume]";
//echo $prenume,$nume,$an,$grupa;
$sql="INSERT INTO datepers (Nume,Prenume,An,Grupa) values
('".$_POST['nume']."','".$_POST['prenume']."','".$_POST['an']."','".$_POST['grupa']."')";
$result=mysql_query($sql);
if($result)
echo "Inregistrarea s-a realizat!";
else
echo "Inregistrarea nu s-a realizat!!";
}
//}
}
if(!empty($_GET['eroare'])){
$era=$_GET['eroare'];
echo "Aveti urmatoarele erori: <br>";
echo $era;
echo $nume;
}
?>
<html>
<head>
<title> Inserare </title>
</head>
<body>
<h1>Formular de inserare in tabela DatePers</h1>
<h3>
<form method="POST" action="">
<p> NUME: <input type="text" name="nume" >
<p> Prenume: <input type="text" name="prenume">
<p> An: <input type="text" name="an">
<p> Grupa: <input type="text" name="grupa">
<p> <input type="submit" name="submit"
value="Insert"></p>
</form>
</h3>
<p><a href="index.html">Index</a></p>
</body>
<html>