gkazhus Posted January 12, 2011 Report Posted January 12, 2011 Vai kaads man var pateikt ko esmu palaidis garaam ka man netiek ierakstiiti dati no laukiem DATEFROM un DATETO? Pareejais straadaa super. $action = $_POST['ac']; $banner_id = $_POST['id']; /* get banner id*/ $newUrl = $_POST['newUrl']; $DATEFROM = $_POST['DATEFROM']; $DATETO = $_POST['DATETO']; $find="http://"; $pos=strpos($newUrl,$find); if($pos===false) $newUrl=$find.$newUrl; if($banner_id!=''){ if($action=='5'){ $sql = "INSERT INTO right_side_banners (DATEFROM) VALUES ('".$DATEFROM."')"; $res = mysql_query($sql) or die(mysql_error()); } { if($action=='6'){ $sql = "INSERT INTO right_side_banners (DATETO) VALUES ('".$DATETO."')"; $res = mysql_query($sql) or die(mysql_error()); } { if($action=='3'){ $sql = "UPDATE right_side_banners SET link_URL='".$newUrl."' WHERE ID=".$banner_id; $res = mysql_query($sql) or die(mysql_error()); } if($action=='4'){ $sqlSelect = "SELECT `banner` FROM right_side_banners WHERE ID=".$banner_id; $resSelect = mysql_query($sqlSelect) or die(mysql_error()); $banner = mysql_fetch_array($resSelect); if($banner[0]!=''){ // delete file $uploaddir_logo = $_SERVER['DOCUMENT_ROOT'].$banner[0]; unlink($uploaddir_logo); // clean DB $sql = "DELETE from right_side_banners WHERE ID=".$banner_id; $res = mysql_query($sql) or die(mysql_error()); } } if($action=='2'){ $sql = "UPDATE right_side_banners SET active='1' WHERE ID=".$banner_id; $res = mysql_query($sql) or die(mysql_error()); } if($action=='1'){ $sql = "UPDATE right_side_banners SET active='0' WHERE ID=".$banner_id; $res = mysql_query($sql) or die(mysql_error()); } } ?> Quote
Blitz Posted January 12, 2011 Report Posted January 12, 2011 1) esi parliecinājies ka $action ir 5 vai 6, un IF "nostrādā"? 2) uztaisi echo $sql; un paskaties kāds izskatās kverijs. 3) man tur izskatās bisk pa daudz { }, pārbaudi sintaksi. Quote
mixis Posted January 12, 2011 Report Posted January 12, 2011 Varbūt, ka nemaz $_POST masīvā nekā nav. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.