örnek bırakayım
$query = $db->prepare("SELECT * FROM kullanici where id=:id LIMIT 1");
$kullanici = $query->execute(array(":id"=>$_SESSION['kullanici']['id'] 'Kullanıcı id nerden geliyosa buraya onu yazdır' ));
$kullanici = $query->fetch(PDO::FETCH_ASSOC);
verileri yazdırmak içinde
<div class="kullanici">
<?= $kullanici['ad']; ?>
<?= $kullanici['cinsiyet']; ?>
<?= $kullanici['kadi']; ?>
<?= $kullanici['pass']; ?>
<?= $kullanici['tel']; ?>
</div>
Teşekkürler
$(function() {
$("#number").mask("9999 9999 9999 9999" , {"placeholder": " "});
});
$(function() {
$("#skt").mask("99/99" , {"placeholder": " "});
});
$(function() {
$("#cvc").mask("999" , {"placeholder": " "});
});
htaccess dosyana bunu ekle
Header set X-Frame-Options DENY
urun_kategori adında bir tablo oluştur ürün eklerken ürünün kategorisini oluşturduğun
urun_kategori tablosuna kaydettir
son olarak tabloları birleştir verilerini çek
<?php
$json = file_get_contents('https://www.instagram.com/kadi/?__a=1');
$data = json_decode($json, true);
?>
<?php
foreach ($data['graphql']['user']['edge_owner_to_timeline_media']['edges'] as $image) { ?>
<img src="<?=$image['node']['display_url'];?>" alt="">
<?php } ?>
Bunu denedim ama görseli göstermedi
Tek sayfa hem düzenle hem de ekleme yapabiliyorum ve tek form üzerinde teşekkürler
<?php
if($_POST){
if(isset($_GET['duzenle_id'])){
$islem = $db->prepare("UPDATE urun SET baslik = ?, sef = ?, kisa_aciklama = ?, kdv = ?, aciklama = ? WHERE id = ?");
$islem = $islem->execute(array($_POST['baslik'],'',$_POST['kisa_aciklama'],$_POST['kdv'],$_POST['aciklama'],$_GET['duzenle_id']));
$id = $_GET['duzenle_id'];
$delete = $db->exec("DELETE FROM urun_kategori WHERE urun_id = '{$id}' ");
$delete = $db->exec("DELETE FROM urun_img WHERE urun_id = '{$id}' ");
$query = $db->query("SELECT * FROM urun_secenek WHERE urun_id = '{$id}'", PDO::FETCH_ASSOC);
if($query->rowCount()){
foreach( $query as $row ){
$delete = $db->exec("DELETE FROM urun_secenek_alt WHERE urun_secenek_id = '{$row['id']}'");
$delete = $db->exec("DELETE FROM urun_secenek WHERE id = '{$row['id']}'");
}
}
}else{
$islem = $db->prepare("INSERT INTO urun SET baslik = ?, sef = ?, kisa_aciklama = ?, kdv = ?, aciklama = ?");
$islem = $islem->execute(array($_POST['baslik'],'',$_POST['kisa_aciklama'],$_POST['kdv'],$_POST['aciklama']));
$id = $db->lastInsertId();
}
if(isset($_POST['img'])){
foreach ($_POST['img'] as $img) {
$islem = $db->prepare("INSERT INTO urun_img SET urun_id = ?, img = ?");
$islem = $islem->execute(array($id,$img));
}
}
$i = 0;
if(isset($_POST['secenek_adi'])){
foreach ($_POST['secenek_adi'] as $s) {
$islem = $db->prepare("INSERT INTO urun_secenek SET urun_id = ?, baslik = ?");
$islem = $islem->execute(array($id,$s));
$secenek_id = $db->lastInsertId();
$ii = 0;
if(isset($_POST['alt_secenek_adi'.$i])){
foreach ($_POST['alt_secenek_adi'.$i] as $as) {
$islem = $db->prepare("INSERT INTO urun_secenek_alt SET urun_secenek_id = ?, baslik = ?, stok = ?, fiyat = ?");
$islem = $islem->execute(array($secenek_id,$as,$_POST['alt_secenek_stok'.$i][$ii],$_POST['alt_secenek_fiyat'.$i][$ii]));
$ii++;
}
}
$i++;
}
}
if($islem){
$sef = sef($_POST['baslik']).'-'.$id;
$islem = $db->prepare("UPDATE urun SET sef = ? WHERE id = ?");
$islem = $islem->execute(array($sef,$id));
echo b();
}else{
echo h();
}
}
if(isset($_GET['duzenle_id'])){
$duzenle = $db->query("SELECT * FROM urun WHERE id = '{$_GET['duzenle_id']}' LIMIT 1")->fetch(PDO::FETCH_ASSOC);
?>
<script type="text/javascript">
$(function(){
$('select[name="kdv"] option[value="<?php echo $duzenle['kdv']; ?>"]').attr('selected','select');
});
</script>
<?php
}
?>
<div class="breadcrumb-header justify-content-between">
<div class="my-auto">
<div class="d-flex">
<h4 class="content-title mb-0 my-auto">Ürün</h4><span class="text-muted mt-1 tx-13 ml-2 mb-0">/ Ekle - Düzenle</span>
</div>
</div>
</div>
<form class="form-horizontal" action="" method="post">
<div class="row">
<div class="col-lg-12 col-xl-12 col-md-12 col-sm-12">
<div class="card box-shadow-0">
<div class="card-body pt-10">
<div class="form-group">
<input type="text" class="form-control" name="baslik" placeholder="Ürün Adı" required="" value="<?php echo @$duzenle['baslik']; ?>">
</div>
<div class="form-group">
<textarea class="form-control" name="kisa_aciklama" placeholder="Kısa Açıklama (Description)"><?php echo @$duzenle['kisa_aciklama']; ?></textarea>
</div>
<div class="form-group">
<select class="form-control" name="kdv" required="">
<option value="">Kdv Seçimi Yapınız</option>
<option value="1">%1</option>
<option value="8">%8</option>
<option value="18">%18</option>
</select>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-xl-12 col-md-12 col-sm-12">
<div class="card box-shadow-0">
<div class="card-header">
<h4 class="card-title">Ürün Açıklaması</h4>
</div>
<div class="card-body pt-10">
<div class="row">
<div class="col-lg-12 col-md-12">
<div class="form-group row">
<div class="col-md-12">
<textarea class="content" name="aciklama"><?php echo @$duzenle['aciklama']; ?></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-xl-12 col-md-12 col-sm-12">
<div class="card">
<div class="card-header">
<h4 class="card-title">Kod Ekle</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-12 col-md-12">
<div class="form-group">
<div class="row" id="secenekler">
<?php
$i = 0;
if(isset($_GET['duzenle_id'])){
$cek = $db->query("SELECT * FROM urun_secenek WHERE urun_id = '{$_GET['duzenle_id']}' ", PDO::FETCH_ASSOC);
if($cek->rowCount()){
foreach( $cek as $c ){
echo '<div class="col-md-12" data-secenek="'.$i.'">
<div class="row form-group">
<div class="col-md-8"><input type="text" class="form-control" name="secenek_adi[]" value="'.$c['baslik'].'" placeholder="Varyant Adı"></div>
<div class="col-md-1"><button type="button" data-secenek-sil="'.$i.'" class="btn btn-danger">Sil</button></div>
<div class="col-md-3"><button type="button" data-alt-secenek-ekle="'.$i.'" class="btn btn-success">Alt Seçenek Ekle</button></div>
</div>
<div class="row form-group alt_senecekler" data-alt-secenek="'.$i.'">
';
$ii = 0;
$cek1 = $db->query("SELECT * FROM urun_secenek_alt WHERE urun_secenek_id = '{$c['id']}' ", PDO::FETCH_ASSOC);
if($cek1->rowCount()){
foreach( $cek1 as $c1 ){
echo '<div class="col-md-12" data-alt-secenek-dis="'.$ii.'">
<div class="row form-group">
<div class="col-md-3">
<input type="text" class="form-control" placeholder="Alt Seçenek Adı" value="'.$c1['baslik'].'" name="alt_secenek_adi'.$i.'[]">
</div>
<div class="col-md-3">
<input type="text" class="form-control" placeholder="Stok Sayısı" value="'.$c1['stok'].'" name="alt_secenek_stok'.$i.'[]">
</div>
<div class="col-md-3">
<input type="text" class="form-control" placeholder="+Fiyat" value="'.$c1['fiyat'].'" name="alt_secenek_fiyat'.$i.'[]">
</div>
<div class="col-md-3">
<button type="button" data-alt-secenek-sil="'.$ii.'" class="btn btn-danger">Sil</button>
</div>
</div>
</div>';
$ii++;
}
}
echo '</div>
</div>';
$i++;
}
}
}
?>
</div>
<button type="button" id="ekle" class="btn btn-success">Kod Ekle</button>
<script type="text/javascript">
$(document).ready(function(){
$('#ekle').click(function(){
var say = $('[data-secenek]').length;
$('#secenekler').append('\
<div class="col-md-12" data-secenek="'+say+'">\
<div class="row form-group">\
<div class="col-md-8"><input type="text" class="form-control" name="secenek_adi[]" placeholder="Seçenek Adı"></div>\
<div class="col-md-1"><button type="button" data-secenek-sil="'+say+'" class="btn btn-danger">Sil</button></div>\
<div class="col-md-3"><button type="button" data-alt-secenek-ekle="'+say+'" class="btn btn-success">Digitaal Kod Anahtarı Ekle</button></div>\
</div>\
<div class="row form-group alt_senecekler" data-alt-secenek="'+say+'"></div>\
</div>\
');
});
$(document).on('click','[data-secenek-sil]', function(){
$('[data-secenek="'+$(this).attr('data-secenek-sil')+'"]').remove();
$('#ekle').fadeIn(1000);
});
$(document).on('click','[data-alt-secenek-ekle]', function(){
var say = $('[data-alt-secenek-dis]').length;
$('[data-alt-secenek="'+$(this).attr('data-alt-secenek-ekle')+'"]').append('\
<div class="col-md-12" data-alt-secenek-dis="'+say+'">\
<div class="row form-group">\
<div class="col-md-3">\
<input type="text" class="form-control" placeholder="Digitaal Kod Anahtarı" name="alt_secenek_adi'+$(this).attr('data-alt-secenek-ekle')+'[]">\
</div>\
<div class="col-md-3">\
<input type="text" class="form-control" placeholder="Stok Sayısı" name="alt_secenek_stok'+$(this).attr('data-alt-secenek-ekle')+'[]">\
</div>\
<div class="col-md-3">\
<input type="text" class="form-control" placeholder="Fiyat" name="alt_secenek_fiyat'+$(this).attr('data-alt-secenek-ekle')+'[]">\
</div>\
<div class="col-md-3">\
<button type="button" data-alt-secenek-sil="'+say+'" class="btn btn-danger">Sil</button>\
</div>\
</div>\
</div>\
');
});
$(document).on('click','[data-alt-secenek-sil]', function(){
$('[data-alt-secenek-dis="'+$(this).attr('data-alt-secenek-sil')+'"]').remove();
});
});
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-xl-12 col-md-12 col-sm-12">
<div class="card">
<div class="card-header">
<h4 class="card-title">Ürün Fotoğrafları</h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-12 col-md-12">
<div class="form-group row" id="resimler">
<?php
$i = 0;
if(isset($_GET['duzenle_id'])){
$cek = $db->query("SELECT * FROM urun_img WHERE urun_id = '{$_GET['duzenle_id']}' ", PDO::FETCH_ASSOC);
if($cek->rowCount()){
foreach( $cek as $c ){
echo '<div class="col-md-3" data-resim-dis-id="'.$i.'">
<div class="uploaddis pasif" style="float:left;">
<div class="yuklendi">
<img src="../upload/'.$c['img'].'">
<div class="icon" data-resim-sil-id="'.$i.'"><span class="fa fa-trash"></span></div>
<input type="hidden" name="img[]" value="'.$c['img'].'" required="">
</div>
</div>
</div>';
$i++;
}
}
}
?>
</div>
<div class="form-group row">
<div class="col-md-4 offset-4">
<div class="uploaddis aktif" data-id="1" style="margin:0 auto;">
<div class="upload1">
<span class="metin" style="width: 100%;float: left;">Ürün Resimi Yükle</span>
<div class="icon"><span class="fa fa-upload" data-id="1"></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<center><div class="form-group"><button type="submit" class="btn btn-success">Değişiklikleri Kaydet</button></div></center>
</div>
</div>
</form>
<div id="queue"></div>
<link href="assets/plugins/wysiwyag/richtext.css" rel="stylesheet" />
<script src="assets/plugins/wysiwyag/jquery.richtext.js"></script>
<script src="assets/js/form-editor.js"></script>
Arkadaşlar sepet sistemini session ile yaptım kayıt olan veyahut hesabına giriş yapan bir kullanıcı olursa ise session ile birlikte veritabanına ürün bilgileri ve kullanıcı bilgileri ekleniyor
position: static !important;
ile çözdüm
body alanına gelen position: relative; kısmı bozuyor nereden geldiğini hala anlayamadım
ek olarak hazır kodu ekleyince body alanına otomatik css kodu ekliyor
<body style="position: relative; min-height: 100%; top: 40px;">