<html>
<body>
<?php
if( !isset($_POST['action_2']))
{
?>
<form id="myform" action="<?php echo $_SERVER["PHP_SELF"]; ?>" method = "POST">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit" name='action_2' value="Submit">
</form>
<?php
}
if(isset($_POST['action_2']))
{
$name=$_POST["name"];
$email=$_POST["email"];
require "ccoonn.php";
mysqli_set_charset($ccoonn, "utf8");
$sql = "INSERT INTO `name_email` (`number`,`name`, `email`) VALUES ('2','$name','$email')";
$result = mysqli_query($ccoonn ,$sql);
echo"ghesmate sabt dar database";
}
?>
</body>
</html>
mysqli_set_charset($ccoonn, "utf8");
require "ccoonn.php";
$sql = "INSERT INTO `name_email` (`number`,`name`, `email`) VALUES ('2','$name','$email')";
$result = mysqli_query($ccoonn ,$sql);
$name=$_POST["name"];
$email=$_POST["email"];
echo"ghesmate sabt dar database";
<html>
<body>
<?php
if( !isset($_POST['action_2']))
{
?>
<form id="myform" action="<?php echo $_SERVER["PHP_SELF"]; ?>" method = "POST">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit" name='action_2' value="Submit">
</form>
<?php
}
if(isset($_POST['action_2']))
{
$name=$_POST["name"];
$email=$_POST["email"];
echo "name= ".$name;
echo"<br>";
echo "email= ".$email;
require "ccoonn.php";
$sql = "INSERT INTO `name_email` (`number`,`name`, `email`) VALUES ('2','$name','$email')";
$result = mysqli_query($ccoonn ,$sql);
echo"<br><br>ghesmate sabt dar database";
}
?>
</body>
</html>
mysqli_set_charset($ccoonn, "utf8");
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
$name=test_input($_POST["name"]);
<html>
<body>
<?php
if( !isset($_POST['action_2']))
{
?>
<form id="myform" action="<?php echo $_SERVER["PHP_SELF"]; ?>" method = "POST">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit" name='action_2' value="Submit">
</form>
<?php
}
if(isset($_POST['action_2']))
{
$name=test_input($_POST["name"]);
$email=test_input($_POST["email"]);
echo "name= ".$name;
echo"<br>";
echo "email= ".$email;
require "ccoonn.php";
mysqli_set_charset($ccoonn, "utf8");
$sql = "INSERT INTO `name_email` (`number`,`name`, `email`) VALUES ('2','$name','$email')";
$result = mysqli_query($ccoonn ,$sql);
echo"<br><br>ghesmate sabt dar database";
}
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
</body>
</html>
<html>
<body>
<?php
require "ccoonn.php";
mysqli_set_charset($ccoonn, "utf8");
$sql = "SELECT * FROM name_email";
$result = mysqli_query($ccoonn ,$sql);
echo"<center>";
echo"<table border=1>";
while($info = mysqli_fetch_array( $result ))
{
echo"<tr>";
$name=$info['name'];
$email=$info['email'];
echo"<td>"; echo $name; echo"</td>";
echo"<td>"; echo $email; echo"</td>"; echo"</tr>";
}
echo"</table>";
echo"</center>";
if( !isset($_POST['action_2']))
{
?>
<form id="myform" action="<?php echo $_SERVER["PHP_SELF"]; ?>" method = "POST">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit" name='action_2' value="Submit">
</form>
<?php
}
if(isset($_POST['action_2']))
{
$name=test_input($_POST["name"]);
$email=test_input($_POST["email"]);
echo "name= ".$name;
echo"<br>";
echo "email= ".$email;
mysqli_set_charset($ccoonn, "utf8");
$sql = "INSERT INTO `name_email` (`number`,`name`, `email`) VALUES ('2','$name','$email')";
$result = mysqli_query($ccoonn ,$sql);
echo"<br><br>ghesmate sabt dar database";
}
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
</body>
</html>
$sql = "SELECT * FROM $the_table ORDER BY number DESC "; // WHERE serialH=4
$sql = "UPDATE $db SET $soton='$meghdar' WHERE number=$number";
$sql = "DELETE FROM $the_table WHERE number=$number";