-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathurunkaydet.php
39 lines (27 loc) · 895 Bytes
/
urunkaydet.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
require_once "config.php";
if(isset($_POST["urun"])){
// urun kayit formundan cekilen bilgiler
$urun = $_POST["urun"];
$model =$_POST["model"];
$kategori = $_POST["kategori"];
$fiyat =intval( $_POST["fiyat"]);
$stok = intval($_POST["stok"]);
$img = $_POST["img"];
}
// mysqli_query($db,"INSERT INTO (username)");
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
// ekleme sorguus
$sql = "INSERT INTO `products`( `urun`,`model`,`kategori`, `fiyat`, `stok`, `img`)
VALUES ('$urun','$model','$kategori',$fiyat,$stok,'$img')";
if (mysqli_query($conn, $sql)) {
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
mysqli_close($conn);
// islem sonrasi yonetici ana sayfasina
header("Location: yonetici.php");
?>