Jump to content

Sil.php Ve Duzenle.php Çalışmıyor


Recommended Posts

arkadaşlar benim düzenle ve sil sayfalarını çalıştıramadım 

sil.php

 

 

 
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
 
<body>
<?php require_once('../../Connections/connection.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;
}
}
 
if ((isset($_GET['UrunID'])) && ($_GET['UrunID'] != "")) {
  $deleteSQL = sprintf("DELETE FROM urun_video WHERE UrunID=%s",
                       GetSQLValueString($_GET['UrunID'], "int"));
 
  mysql_select_db($database_connection, $connection);
  $Result1 = mysql_query($deleteSQL, $connection) or die(mysql_error());
 
  $deleteGoTo = "index.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
    $deleteGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $deleteGoTo));
}
?>
</body>
</html>
 
duzenle.php
<?php require_once('../../Connections/connection.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;
}
}
 
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
 
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
  $updateSQL = sprintf("UPDATE urun_video SET UrunID=%s, VidioAdi=%s, VidioKodu=%s WHERE VidioID=%s",
                       GetSQLValueString($_POST['UrunID'], "int"),
                       GetSQLValueString($_POST['VidioAdi'], "text"),
                       GetSQLValueString($_POST['VidioKodu'], "text"),
                       GetSQLValueString($_POST['VidioID'], "int"));
 
  mysql_select_db($database_connection, $connection);
  $Result1 = mysql_query($updateSQL, $connection) or die(mysql_error());
 
  $updateGoTo = "index.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
    $updateGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $updateGoTo));
}
 
mysql_select_db($database_connection, $connection);
$query_rsUrun = "SELECT UrunID, UrunAdi FROM urun";
$rsUrun = mysql_query($query_rsUrun, $connection) or die(mysql_error());
$row_rsUrun = mysql_fetch_assoc($rsUrun);
$totalRows_rsUrun = mysql_num_rows($rsUrun);
 
$colname_rsVideo = "-1";
if (isset($_GET['VidioID'])) {
  $colname_rsVideo = $_GET['VidioID'];
}
mysql_select_db($database_connection, $connection);
$query_rsVideo = sprintf("SELECT * FROM urun_video WHERE VidioID = %s", GetSQLValueString($colname_rsVideo, "int"));
$rsVideo = mysql_query($query_rsVideo, $connection) or die(mysql_error());
$row_rsVideo = mysql_fetch_assoc($rsVideo);
$totalRows_rsVideo = mysql_num_rows($rsVideo);
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ürün-video düzenle</title>
</head>
 
<body>
Ürün Video düzenle
<br>
<br>
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
  <table align="center">
    <tr valign="baseline">
      <td nowrap align="right">UrunID:</td>
      <td><select name="UrunID">
        <?php 
do {  
?>
        <option value="<?php echo $row_rsUrun['UrunID']?>" <?php if (!(strcmp($row_rsUrun['UrunID'], htmlentities($row_rsVideo['UrunID'], ENT_COMPAT, 'utf-8')))) {echo "SELECTED";} ?>><?php echo $row_rsUrun['UrunAdi']?></option>
        <?php
} while ($row_rsUrun = mysql_fetch_assoc($rsUrun));
?>
      </select></td>
    <tr>
    <tr valign="baseline">
      <td nowrap align="right" valign="top">VidioAdi:</td>
      <td><textarea name="VidioAdi" cols="50" rows="5"><?php echo htmlentities($row_rsVideo['VidioAdi'], ENT_COMPAT, 'utf-8'); ?></textarea></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right" valign="top">VidioKodu:</td>
      <td><textarea name="VidioKodu" cols="50" rows="5"><?php echo htmlentities($row_rsVideo['VidioKodu'], ENT_COMPAT, 'utf-8'); ?></textarea></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">&nbsp;</td>
      <td><input type="submit" value="değişiklikleri kaydet"></td>
    </tr>
  </table>
  <input type="hidden" name="MM_update" value="form1">
  <input type="hidden" name="VidioID" value="<?php echo $row_rsVideo['VidioID']; ?>">
</form>
<p>&nbsp;</p>
</body>
</html>
<?php
mysql_free_result($rsUrun);
 
mysql_free_result($rsVideo);
?>
 
 
Link to comment
Share on other sites

  • 2 hafta sonra ...

Bu Şekilde Kesinlikle Yardım alamazsın...
Bu Sayfada Güncelleme ve listeleme işlemi yapılıyor...
Sen sil.php,nin çalışmadıgı söylüyorsun.
aldıgın Hata Nedir
Yani : Hata kodu mu alıyorsun,yoksa sayfa mı tetiklemiyor...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...