Merhaba arkadaşlar,
Yeni yeni öğreniyorum saçmalarsam kusuruma bakmayın
Şimdi benim kendime yazdırdığım Şarkı sözü scriptine Katagori Eklemey olayı yapmaya çalışıyorum fakat yapamadım bir türlü.
Şimdi arkadaşlar,
Admin panelden başlayalım.
kategori.php <?php require_once('../klip.php'); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "admin";
$MM_donotCheckaccess = "false";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && false) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "giris.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<TD align=middle width=590>
<?
$ix = $_POST['ix'];
if($ix == "1"){
$adi = $_POST['adi'];
$id = $_GET['id'];
$aciklama = $_POST['aciklama'];
$adi_s = trsil($adi);
$result = mysql_query("update kategori set adi = '$adi', aciklama = '$aciklama' where id=".$id);
echo "<b>Kategori düzenlendi!!<br> ";
}else{
$id = $_GET['id'];
$q=mysql_query("select * from kategori where id='$id'");
$r=mysql_fetch_array($q);
?>
<TABLE class="title-header capitalize" cellSpacing=0 cellPadding=0
width=550 align=center border=0>
<TBODY>
<TR>
<TD width="100%">Kategori Düzenle</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=0 cellPadding=0 width=546 align=center
border=0><TBODY>
<TR height=25>
<FORM
action="kategori.php?id=<? echo $id ?>" method="post" ?> <input type=hidden name=ix value=1>
<TD align=left><B>Kategori Adı:</B></TD>
<TD><INPUT class=field value="<? echo $r[adi] ?>"
style="WIDTH: 200px; HEIGHT: 20px" size=10
name=adi></TD></TR>
<TR height=25>
<TD align=left><B>Açıklama :</B></TD>
<TD><textarea rows=10 cols=40 name=aciklama ><? echo $r[aciklama] ?></textarea></TD></TR>
<TR height=35>
<TD align=left></TD>
<TD><INPUT class=button type=submit value=Düzenle name=send_button></TD></TR></TBODY></TABLE><BR><BR><?
}
include("footer.php");
?>katagoriekle.php <?php require_once('../klip.php'); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "admin";
$MM_donotCheckaccess = "false";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && false) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "giris.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<TD align=middle width=590>
<?
$ix = $_POST['ix'];
if($ix == "1"){
$adi = $_POST['adi'];
$aciklama = $_POST['aciklama'];
$strSQL = "INSERT INTO kategori (adi,aciklama) VALUES('$adi','$aciklama')";
mysql_query($strSQL);
echo "<b>Kategori eklendi!!<br> ";
}
?>
<TABLE class="title-header capitalize" cellSpacing=0 cellPadding=0
width=550 align=center border=0>
<TBODY>
<TR>
<TD width="100%">Kategori Ekle</TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=0 cellPadding=0 width=546 align=center
border=0><TBODY>
<TR height=25>
<FORM
action=kategoriekle.php
method=post><input type=hidden name=ix value=1>
<TD align=left><B>Kategori Adı:</B></TD>
<TD><INPUT class=field
style="WIDTH: 200px; HEIGHT: 20px" size=10
name=adi></TD></TR>
<TR height=25>
<TD align=left><B>Açıklama :</B></TD>
<TD ><textarea name=aciklama rows=10 cols=40></textarea></TD></TR>
<TR height=35>
<TD align=left></TD>
<TD><INPUT class=button type=submit value=Ekle name=send_button></TD></TR></TBODY></TABLE><BR><BR> katagoriler.php <?php require_once('../klip.php'); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "admin";
$MM_donotCheckaccess = "false";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && false) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "giris.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<TD align=left width=590>
<?
?><table><tbody><?
$q=mysql_query("select * from kategori");
while ($r=mysql_fetch_array($q))
echo "<tr><td> <A class=ucwords href=kategori.php?id=$r[id]><b>» $r[adi]</b></A></td>
<td> <A class=ucwords href=kategori.php?id=$r[id]><b>» Düzenle</b></A></td>
<td> <A class=ucwords href=kategorisil.php?id=$r[id]><b>» Sil</b></A></td></tr>";
?> </tbdoy></table> katagorisil.php <?php require_once('../klip.php'); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "admin";
$MM_donotCheckaccess = "false";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && false) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "giris.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<TD align=middle width=590>
<?
$id = $_GET['id'];
$strSQL = "Delete from kategori where id = $id";
mysql_query($strSQL);
$strSQL2 = "Delete from video where kategori = $id";
mysql_query($strSQL2);
echo "<b>Kategori ve kategoriye ait tüm veriler silindi!!<br> ";
?>
Buraya Kadar hiç bir sorun yok. Katagori ekleniyor siliniyor fakat katagori düzenlemeye giriyorum düzenle diyorum bir hata veriyor buraya kadarki tek sorunum bu şuanlık.
Fakat sarkiciekle.php den şarkıcıyı katagoriye atayamadım kodları aşağıda..
sarkiciekle.php <?php require_once('../klip.php'); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "admin";
$MM_donotCheckaccess = "false";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && false) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "giris.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$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_insert"])) && ($_POST["MM_insert"] == "sanatciekle")) {
$insertSQL = sprintf("INSERT INTO sanatci (isim, bilgi) VALUES (%s, %s)",
GetSQLValueString($_POST['isim'], "text"),
GetSQLValueString($_POST['isim'], "text"));
mysql_select_db($database_klip, $klip);
$Result1 = mysql_query($insertSQL, $klip) or die(mysql_error());
$insertGoTo = "sarkiciekle.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9" />
<title>Admin Panel</title>
<link href="../imgs/yh2.css" rel="stylesheet" type="text/css" />
<link href="../imgs/cm1.css" rel="stylesheet" type="text/css" />
<link href="admncss.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="admin_menu">
<ol id="menu">
<li><font face="Trebuchet MS" size="3"><b>
<a title="Birinci Link icin buraya tikla " accesskey="1" href="index.php">Ana Sayfa</a></b></font></li>
<li>
<b>
<font face="Trebuchet MS" size="3">
<a title="Birinci Link icin buraya tikla " accesskey="1" href="sarkiciekle.php">
Şarkıcı Ekle</a></font></b></li>
<li>
<b>
<font face="Trebuchet MS" size="3">
<a title="Birinci Link icin buraya tikla " accesskey="1" href="sarkiekle.php">
Şarkı Sözü Ekle</a></font></b></li>
<li>
<p style="text-align: right"><b><font face="Trebuchet MS" size="3"><a title="Birinci Link icin buraya tikla " accesskey="1" href="duzenle.php">
Şarkı Sözü Düzenle</a></font></b></li>
<li><b><font face="Trebuchet MS" size="3"><a href="fikra_duzenle" title="Dorduncu Link icin buraya tikla" accesskey="4">
<a href="istekler.php">İstekler</a></font><font size="3" color="#000000"></a></font></b></li>
</ol>
</div>
<p><form method="POST" action="<?php echo $editFormAction; ?>" name="sanatciekle">
<p><font face="Trebuchet MS"><b><font color="#FF0000" size="5">Sanatçı Ekle</font></b></font></p>
<p> <TR height=25>
<TD align=left><B>Kategori :</B></TD>
<TD ><select name="kategori">
<?
$q2=mysql_query("select * from kategori");
while ($r2=mysql_fetch_array($q2))
echo "<option value=$r2[id]>$r2[adi]</option>";
?>
</select></TD></TR></p>
<p>
<font face="Trebuchet MS"><b><br />Sanatçı Adı:</b></font><br />
<input type="text" name="isim" value="" size="37" style="font-family: Trebuchet MS; font-size: 12pt; font-weight: bold; border: 3px solid #CBE052" /><br />
<font size="3" face="Trebuchet MS">
<input type="submit" value="Sarkıcıyı Ekle!" style="font-weight: bold; height:30; width:310; font-size:14pt; font-family:Trebuchet MS" /></font>
<input type="hidden" name="MM_insert" value="sanatciekle">
</p>
</form></td></p>
<p> </p>
<p><b><font face="Trebuchet MS" size="5">Admin Panele Hoşgeldiniz.</font></b></p>
<p> </p>
<p><b><font face="Trebuchet MS">Yapmak İstediğiniz İşlem İçin Üst Menüden Bir
Seçenek Seçiniz..</font></b></p>
</body>
</html>Burdan katagoriyi seçip Sanatcıyı kaydettiğimde olmuyor bir sorun çıkarıyor :S
Bundan sonraki sorunlarımıda yazayım size
Anasayfada bu katagorileri gösterdim fakat altındaki şarkı sözlerini göstermek istiyorum bundada bi problem var sanırsam ama tam bilemiyorum şarkıcıya katagori ekleyemediğim için.
Yardımlarınız için şimdiden teşekkür ederim.
Kolay gelsin. Umarım başınızı ağrıtmaz

Yada daha kolay bi katagori sistemi varsa oda olur anlatımlı falan