Şimdi Ara

Php Div Load sorunum

Daha Fazla
Bu Konudaki Kullanıcılar: Daha Az
2 Misafir - 2 Masaüstü
5 sn
7
Cevap
0
Favori
772
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • Arkadaşlar herkese selamlar. Kendi çapımda evde php öğrenmeye çalışıyorum ve bu amaçla da bir web site hazırlıyorum.
    Admin panelimde alttaki gösterdiğim resimlerde 1. resimde solda menüler ve sağda da admin işlemlerini yapacağım ekranım gözüküyor. 1. resimde Kategori ekle bölümünde kategori adı yazıp EKLE butonuna basınca sayfa direk 2. resimdeki gibi yani solda menüler olmadan sadece Kategori_ekle.php sayfam olarak gözüküyor. Ben EKLE me işlemi yaptıktan sonra tekrar admin ana sayfası içinde yani 1. resimdeki gibi ilk haline dönsün istiyorum. Bunu nasıl yaparım. Ekle butonuna nasıl bir kod yazmam gerekiyor acaba. Yardımcı olursanız sevinirim.
    1. RESİM  Php Div Load sorunum

    ------------------------------------

    2. RESİM  Php Div Load sorunum








    < Bu mesaj bu kişi tarafından değiştirildi asker3457 -- 29 Mart 2015; 14:11:24 >







  • Kategori ekle sayfasında işlemleri yaptığın koddan sonra şunu ekle:

    header("Location: index.php");

    Kategoriyi ekledikten sonra admin index sayfasına döner.
  • asker3457 merhabalar,

    alpasp dedigi gibi , header("Location: index.php"); kullanabilirsin. Ama her zaman bu calismayabilir. Mesela : eğer yönlendirmekten önce bir şey yankılandıysa, hata cikabilir.
    Baska cozumlerimiz:

    1. header(); normalde sayfasinin en yukarisinda olmali.
    2. php ile Javascript olarak kullanabilirsin:
     echo "<script type='text/javascript'>window.location.href = 'page1.php';</script>" 
    exit();


    Haberlerini bekliyoruz.

    Ve tabiki, yapabilmezsen, biraz kod ornek ver ki yardim edelim.
  • Bende bunu öğrenmek istiyorum mesela karşımızda 3/4 seçenek var biri seçildiğinde tamam oraya yönlendiriyiroum fakat aynı tasarımı yönlendirilen yerede mi aktarmam gerekiyor?
  • Bir arkadasla konustum, client-side bakimindan 2.ci dedigim yol tavsiye degilmis.
    Ya sadece header() kullanmak (ama en dikkate etmelisin, dedigim gibi, headerden once bir baska kodlarin gonderilmesin), ya da: ob_start() baslangicta ve ob_flush() sonda kullanabilirsin.
    Kisa ornek:
    ob_start(); 
    echo("Hello there!"); //would normally get printed to the screen/output to browser
    $output = ob_get_contents();
    ob_flush();


    Baska sorularin varsa, sor, ve daha cok detayli olsun lutfen
  • Arkadaşlar öncelikle tüm cevaplar için herkese teşekkür ederim.

    @alpasp arkadaşımızın dediği şekilde header("Location: index.php"); ekleyerek sorunumu şuan için çözmüş bulunuyorum.

    Diğer yöntemlerinize deneyip bilgi vereceğim.

    Çok çok teşekkürler tekrardan.
  • @dbd Şimdide aynı sorunu bu sayfada alıyorum. Bu sefer dediğin gibi header("Location: index.php"); burada çalışmıyor. yada ben beceremedim

     Php Div Load sorunum

    Resimdeki Yeşil barda ilk ve son yazıları var. Onlara tıklayaınca bu sefer aynı sorun başıma geliyor.

    Ne yapmam lazım acaba.

    <?php require_once('../Connections/baglantim.php'); ?> 
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
    if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
    }

    $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

    switch ($theType) {
    case "text":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
    break;
    case "long":
    case "int":
    $theValue = ($theValue != "") ? intval($theValue) : "NULL";
    break;
    case "double":
    $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
    break;
    case "date":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
    break;
    case "defined":
    $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
    break;
    }
    return $theValue;
    }
    }

    $currentPage = $_SERVER["PHP_SELF"];

    $maxRows_Recordset1 = 10;
    $pageNum_Recordset1 = 0;
    if (isset($_GET['pageNum_Recordset1'])) {
    $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
    }
    $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;

    mysql_select_db($database_baglantim, $baglantim);
    $query_Recordset1 = "SELECT * FROM kategori_tablosu ORDER BY kat_id ASC";
    $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
    $Recordset1 = mysql_query($query_limit_Recordset1, $baglantim) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);

    if (isset($_GET['totalRows_Recordset1'])) {
    $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
    } else {
    $all_Recordset1 = mysql_query($query_Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
    }
    $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;

    $queryString_Recordset1 = "";
    if (!empty($_SERVER['QUERY_STRING'])) {
    $params = explode("&", $_SERVER['QUERY_STRING']);
    $newParams = array();
    foreach ($params as $param) {
    if (stristr($param, "pageNum_Recordset1") == false &&
    stristr($param, "totalRows_Recordset1") == false) {
    array_push($newParams, $param);
    }
    }
    if (count($newParams) != 0) {
    $queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
    }
    }
    $queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);

    ?>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>

    <body>
    <table width="700" border="1" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td height="50" align="center" valign="middle" bgcolor="#99CC00"><table width="100%" border="1" cellspacing="0" cellpadding="0">
    <tr>
    <td height="30" align="center" bgcolor="#00CCFF"><h3>Kategori ID</h3></td>
    <td height="30" align="center" bgcolor="#00CCFF"><h3>Kategori Adı</h3></td>
    <td height="30" align="center" bgcolor="#00CCFF"><h3>Düzenle</h3></td>
    <td height="30" align="center" bgcolor="#00CCFF"><h3>Sil</h3></td>
    </tr>
    <?php do { ?>
    <tr>
    <td height="30" bgcolor="#00CCFF"><?php echo $row_Recordset1['kat_id']; ?></td>
    <td height="30" bgcolor="#00CCFF"><?php echo $row_Recordset1['kat_adi']; ?></td>
    <td height="30" bgcolor="#00CCFF">Düzenle</td>
    <td height="30" bgcolor="#00CCFF">Sil</td>
    </tr>
    <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
    </table>
    <table border="0">
    <tr>
    <td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
    <a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=104305701&url=<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>" data-href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>">ilk</a>
    <?php } // Show if not first page ?></td>
    <td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
    <a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=104305701&url=<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>" data-href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>">Geri</a>
    <?php } // Show if not first page ?></td>
    <td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
    <a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=104305701&url=<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>" data-href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>">İleri</a>
    <?php } // Show if not last page ?></td>
    <td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
    <a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=104305701&url=<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>" data-href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>">Son</a>
    <?php } // Show if not last page ?></td>
    </tr>
    </table></td>
    </tr>
    </table>

    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>



    < Bu mesaj bu kişi tarafından değiştirildi asker3457 -- 30 Mart 2015; 21:53:42 >




  • 
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.