<?php
<?php
$hostname ="localhost";
$username="gyak";
$password= "2R6o42PV";
$databaseName = "gyak";
$connect = mysqli_connect($hostname, $username, $password, $databaseName);
/*
if(!$conn) {
die("A kapcsolódás sikertelen: " . mysqli_connect_error());
echo "Nem sikerült";
} else {
echo "Sikerült";
}
*/
//Felvitel 1 - Dolgozók felvitele
$username1 = htmlspecialchars($_POST['username1']);
$address = htmlspecialchars($_POST['address']);
$con = mysql_connect("localhost","gyak","2R6o42PV");
if (!$con)
{
die('Nem sikerült!: ' . mysql_error());
} else {
// echo "Siker!";
}
mysql_select_db("gyak", $con);
if($_POST)
{
$username1=$_POST['username1'];
$address=$_POST['address'];
$sql="INSERT INTO Dolgozók(Name, Email)VALUES('$username1', '$address')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
mysql_close($con);
}
?>
<?php
<?php
$hostname ="localhost";
$username="gyak";
$password= "2R6o42PV";
$databaseName = "gyak";
$connect = mysqli_connect($hostname, $username, $password, $databaseName);
/*
if(!$conn) {
die("A kapcsolódás sikertelen: " . mysqli_connect_error());
echo "Nem sikerült";
} else {
echo "Sikerült";
}
*/
//Felvitel 1 - Dolgozók felvitele
$username1 = htmlspecialchars($_POST['username1']);
$address = htmlspecialchars($_POST['address']);
$con = mysql_connect("localhost","gyak","2R6o42PV");
if (!$con)
{
die('Nem sikerült!: ' . mysql_error());
} else {
// echo "Siker!";
}
mysql_select_db("gyak", $con);
if($_POST)
{
$username1=$_POST['username1'];
$address=$_POST['address'];
$sql="INSERT INTO Dolgozók(Name, Email)VALUES('$username1', '$address')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
mysql_close($con);
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Dolgozók felvitele</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="urlapcss.css" type="text/css">
</head>
<body>
<div id="container">
<form id="reg" action="felvitel1.php" method="post">
<fieldset>
<legend>Dolgozók</legend>
<ol>
<li>
<label for="username1">Név<em>*</em></label>
<input id="username1" type="text" name="username1"/>
</li><li>
<label for="address">E-mail<em>*</em></label>
<input id="address" type="text" name="address" />
</li>
</ol>
</fieldset>
<input type="submit" value="OK"/>
<a href="fooldal.html">Vissza</a>
</form>
</div>
</body>
</html>
每次刷新此页面时,我都会弹出消息:您正在寻找的页面是您输入的使用信息。返回该页面可能会导致您重复执行任何操作。您要继续吗?
此代码有什么问题?请帮助我