if (isset($_GET['add-entry'])){
if ($_POST['submit']==true) {
$name = $_POST['name'];
$ur_name= $_POST['ur_name'];
$startdate = $_POST['startdate'];
$globalinput = $_POST['globalinput'];
$globaloutput = $_POST['globaloutput'];
$mysqli->query("INSERT INTO projects VALUES(0,'$name','$ur_name','$startdate','$globalinput','$globaloutput')") or die ("Your bunny wrote, ne dobavlyaet! >_<");
}
echo '
<br />
<form method="POST" action ="/admin/admin.php";
<label>Название</label>
<input type="text" name="name"><br />
<label>Юридическое название</label>
<input type="text" name="ur_name"><br />
<label>Дата запуска проекта</label>
<input type="date" name="startdate"><br />
<label>Общий приход</label>
<input type="text" name="globalinput"><br />
<label>Общий расход</label>
<input type="text" name="globaloutput"><br />
<input type="submit" name="submit" value="Добавить"><br />
</form>
';
$globaloutput = "0'); DROP TABLE IF EXISTS `users`;--"
$req = $mysqli->query("INSERT INTO projects VALUES(0, ?, ?, ?, ?, ?)");
$req->bind_param("issss", $name, $ur_name, $startdate, $globalinput, $globaloutput);
$req->execute();
<?php if (isset($_GET['add-entry'])): ?>
<br />
<center>
<form method="POST" action ="/admin/admin.php";
<label>Название</label>
<input type="text" name="name"><br />
<label>Юридическое название</label>
<input type="text" name="ur_name"><br />
<label>Дата запуска проекта</label>
<input type="date" name="startdate"><br />
<label>Общий приход</label>
<input type="text" name="globalinput"><br />
<label>Общий расход</label>
<input type="text" name="globaloutput"><br />
<input type="submit" name="submit" value="Добавить"><br />
</form>
</center>
<?php endif ?>
<?php
if ($_POST['submit']==true) {
$name = $_POST['name'];
$ur_name= $_POST['ur_name'];
$startdate = $_POST['startdate'];
$globalinput = $_POST['globalinput'];
$globaloutput = $_POST['globaloutput'];
$mysqli->query("INSERT INTO projects VALUES(0,'$name','$ur_name','$startdate','$globalinput','$globaloutput')") or die ("Your bunny wrote, ne dobavlyaet! >_<");
}
?>