Не ъпдейтва полетата ..

justspy

Registered
Неми ъпдейтва полетата .. смисал влизам в админ панела и искам да редактирам нещо .. променям го обаче то несе променя :D ето кода ..


<? include("conn.php") ?>
<?
$dei = $_GET['dei'];
$id = $_GET['id'];
if ( $dei == 'del' )
{
mysql_query("DELETE FROM songs WHERE id = '$id'");
}
else
{

$save = $_GET['save'];
if ( $save == 'true' )
{
$artist = $my['artist'];
$title = $my['title'];
$path = $my['path'];
$author = $my['author'];
$size = $my['size'];
mysql_query("UPDATE `songs` SET name='$artist', title='$title', path='$path', size='$size' WHERE id='".$id."'");
}
else
{
$sql = "SELECT * FROM songs WHERE id = '$id'";
$do = mysql_query($sql);
$my = mysql_fetch_array($do);
$artist = $my['artist'];
$title = $my['title'];
$path = $my['path'];
$author = $my['author'];
$size = $my['size'];
echo '<form action=sadm.php?dei=edit&save=true&id='.$id.' method=post> Изпълнител: <BR> <input type=text name=name value="'.$artist.'"> <BR> Песен : <BR> <input type=text name=name value="'.$title.'"> <BR> Линк : <BR> <input name=link type=text value="'.$path.'"> <BR> Добавил: <BR> <input type=text name=name value="'.$author.'"> <BR> Големина: <BR> <input type=text name=size value="'.$size.'"> <BR> <input type=submit></form>';
}
}
?>
 
Дебъгване!!!
<? include("conn.php") ?>
<?
$dei = $_GET['dei'];
$id = $_GET['id'];
if ( $dei == 'del' )
{
mysql_query("DELETE FROM songs WHERE id = '$id'");
}
else
{

$save = $_GET['save'];
if ( $save == 'true' )
{
$artist = $my['artist'];
$title = $my['title'];
$path = $my['path'];
$author = $my['author'];
$size = $my['size'];
echo $id; // само за проверка
mysql_query("UPDATE `songs` SET name='$artist', title='$title', path='$path', size='$size' WHERE id='$id') or die(myql_error());
}
else
{
$sql = "SELECT * FROM songs WHERE id = '$id'";
$do = mysql_query($sql);
$my = mysql_fetch_array($do);
$artist = $my['artist'];
$title = $my['title'];
$path = $my['path'];
$author = $my['author'];
$size = $my['size'];
echo '<form action=sadm.php?dei=edit&save=true&id='.$id.' method=post> Изпълнител: <BR> <input type=text name=name value="'.$artist.'"> <BR> Песен : <BR> <input type=text name=name value="'.$title.'"> <BR> Линк : <BR> <input name=link type=text value="'.$path.'"> <BR> Добавил: <BR> <input type=text name=name value="'.$author.'"> <BR> Големина: <BR> <input type=text name=size value="'.$size.'"> <BR> <input type=submit></form>';
}
}
?>
 
Код:
include("conn.php") ?>
<?
$dei = $_GET['dei'];
$id = $_GET['id'];
if ( $dei == 'del' )
{
mysql_query("DELETE FROM songs WHERE id = '$id'");
}
else
{
if ( $_POST['editsong']){
$artist = $_POST['artist'];
$title = $_POST['title'];
$path = $_POST['link'];
$author = $_POST['author'];
$size = $_POST['size'];
mysql_query("UPDATE `songs` SET name='$artist', title='$title', path='$path', size='$size' WHERE id='".$id."'");
}
else
{
$sql = "SELECT * FROM songs WHERE id = '$id'";
$do = mysql_query($sql);
$my = mysql_fetch_array($do);
$artist = $my['artist'];
$title = $my['title'];
$path = $my['path'];
$author = $my['author'];
$size = $my['size'];
echo '<form action=\"?dei=edit\" method=post> Изпълнител: <BR> <input type=text name=artist value="'.$artist.'"> <BR> Песен : <BR> <input type=text name=title value="'.$title.'"> <BR> Линк : <BR> <input name=link type=text value="'.$path.'"> <BR> Добавил: <BR> <input type=text  name=author value="'.$author.'"> <BR> Големина: <BR> <input type=text name=size value="'.$size.'"> <BR> <input type=submit name=editsong></form>';
}
}
?>
тека?
 
Код:
include("conn.php") ?>
<?
$dei = $_GET['dei'];
$id = $_GET['id'];
if ( $dei == 'del' )
{
mysql_query("DELETE FROM songs WHERE id = '$id'");
}
else
{
if ( $_POST['editsong']){
$artist = $_POST['artist'];
$title = $_POST['title'];
$path = $_POST['link'];
$author = $_POST['author'];
$size = $_POST['size'];
mysql_query("UPDATE `songs` SET name='$artist', title='$title', path='$path', size='$size' WHERE id='".$id."'");
}
else
{
$sql = "SELECT * FROM songs WHERE id = '$id'";
$do = mysql_query($sql);
$my = mysql_fetch_array($do);
$artist = $my['artist'];
$title = $my['title'];
$path = $my['path'];
$author = $my['author'];
$size = $my['size'];
echo '<form action=\"?del=edit&id=$id\" method=post> Изпълнител: <BR> <input type=text name=artist value="'.$artist.'"> <BR> Песен : <BR> <input type=text name=title value="'.$title.'"> <BR> Линк : <BR> <input name=link type=text value="'.$path.'"> <BR> Добавил: <BR> <input type=text  name=author value="'.$author.'"> <BR> Големина: <BR> <input type=text name=size value="'.$size.'"> <BR> <input type=submit name=editsong></form>';
}
}
?>
тека?
 
<?
include("conn.php");
$id=$_GET['id'];
$sql=mysql_query("SELECT * FROM `songs` WHERE id='$id'") or die(mysql_error());
while($row=mysql_fetch_array($sql)){
$author = $row['author'];
$artist = $row['artist'];
$title = $row['title'];
$path = $row['path'];
$size = $row['size'];
?>
<form action="" method="POST">
Автор:<input type='text' name='author' value='<? echo $author; ?>'><br />
Изпълнител:<input type='text' name='artist' value='<? echo $artist; ?>'><br />
Песен:<input type='text' name='title' value='<? echo $title; ?>'><br />
Линк:<input type='text' name='path' value='<? echo $path; ?>'><br />
Размер:<input type='text' name='size' value='<? echo $size; ?>'><br />
<input type='submit' name='button' value='ЖЕГА!'><br />
</form>
<?
}
$author1= htmlspecialchars($_POST['author']);
$artist1= htmlspecialchars($_POST['artist']);
$title1= htmlspecialchars($_POST['title']);
$path1= htmlspecialchars($_POST['path']);
$size1= htmlspecialchars($_POST['size']);
$button=$_POST['button'];
if($button) {
$mysql=mysql_query("UPDATE `songs` set author='$author1', artist='$artist1', title='$title1', path='$path1', size='$size1' WHERE id='$id'") or die(mysql_error());
}
if($mysql) {
print "Песента е обновена успешно!"; }
?>
 
Вие дадохте една точка за support на DeathGuard_ .
Натиснете тук за да се върнете в темата.
 

Горе