- Home
- Categorie
- Coding e Sistemistica
- PHP
- Non cancella
-
Non cancella
Ciao a tutti, in questo codice non cancella il contatto selezionato
[PHP]$byview = ">->By: <a href="index.php?action=viewuser&who=$item[1]">".getsimbol($item[1])."$bonick</a>";if(candelbl($uid,$item[0])) { $dl = "|<a href=\"index.php?action=delhi5&bid=$item[0]\">[X]</a>"; }else{ $dl = ""; }
if(candelmd(getuid_sid($sid), $bid))
{
$res = mysql_query("DELETE FROM lirhi5 WHERE id='".$bid."'"); if($res) { echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Hi5 cancellato<br/>"; }else{ echo "<img src=\"../notok.gif\" alt=\"x\"/>Error!<br/>"; }[/PHP]
se clicco per cancellare
[PHP]$dl = "|<a href="index.php?action=delhi5&bid=$item[0]">[X]</a>";[/PHP]
mi fa uscire dal mio sito..
ho provato a cambiare:
$res = mysql_query("DELETE FROM lirhi5 WHERE id='".$bid."'");con questo:
$res = mysql_query("DELETE FROM lirhi5 WHERE id='$bid");
..ma da stesso risultato, chi puo risolvere il problema?:?
-
Non ho visto tutto il codice ma nell'ultima query ho notato un apice di troppo, prova con questa
$res = mysql_query("DELETE FROM lirhi5 WHERE id=$bid");
-
mi porta fuori dal mio sito.. qua c'è il codice
[PHP]//////////////////////////////////lirhi5
else if($action=="hi5")
{
$whonick = getnick_uid($who);
$who = $_GET["who"];
addonline(getuid_sid($sid),"Aggiunge indirizzi hi5","index.php?action=$action");
echo "<head>";
echo "<title>$stitle</title>";
echo "<link rel="stylesheet" type="text/css" href="themes/$theme[0]">";
echo "</head>";
echo "<body>";
$uid = getuid_sid($sid);//////ALL LISTS SCRIPT << if($page=="" || $page<=0)$page=1; $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lirhi5")); $num_items = $noi[0]; //changable $items_per_page= 10; $num_pages = ceil($num_items/$items_per_page); if(($page>$num_pages)&&$page!=1)$page= $num_pages; $limit_start = ($page-1)*$items_per_page;
$sql = "SELECT id, uid, adresa FROM lirhi5 ORDER by id DESC LIMIT $limit_start, $items_per_page";
echo "<p align="center">";
// alerte
$uid = getuid_sid($sid);
$unreadpopup=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lirpopups WHERE unread='1' AND touid='".$uid."'"));
if ($unreadpopup[0]>0)
{
echo popup($sid);
echo "</p>";
echo "</body>";
echo "</html>";
exit();
}
echo "<img src="../images/meditatii.gif" alt=""/><b>Indirizzi Hi5</b><br/><br/>";
echo "<a href="index.php?action=adaugahi5&sid=$sid">(Aggiungi tuoi indirizzi qui hi5)</a><br/>";
echo "<p>";
echo "<p align="left">";
$items = mysql_query($sql);
echo mysql_error();
if(mysql_num_rows($items)>0)
{
while ($item = mysql_fetch_array($items))
{
$descriere = parsepm($item[3], $sid);
$bonick = getnick_uid($item[1]);
$byview = ">->By: <a href="index.php?action=viewuser&who=$item[1]&sid=$sid">$bonick</a>";
if(candelbl($uid,$item[0]))
{
$dl = "|<a href="index.php?action=delhi5&did=$item[0]">[X]</a>";
}else{
$dl = "";
}echo " <small><b><font color=\"#88CC00\"><a href=\"$item[2]\">$item[2]</a> </font></b>$byview</small>
<small></small>$dl <br/>
";
// echo "$lnk";} } echo "</p>"; echo "<p align=\"center\">"; if($page>1) { $ppage = $page-1; echo "<a href=\"index.php?action=$action&page=$ppage&view=$view\">«Indietro</a> "; } if($page<$num_pages) { $npage = $page+1; echo "<a href=\"index.php?action=$action&page=$npage&view=$view\">Avanti»</a>"; } echo "<br/>$page/$num_pages<br/>"; if($num_pages>2) { $rets = "<form action=\"index.php\" method=\"get\">"; $rets .= "<input name=\"page\" style=\"-wap-input-format: '*N'\" size=\"2\"/>"; $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>"; $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>"; $rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\"/>"; $rets .= "<input type=\"hidden\" name=\"view\" value=\"$view\"/>"; $rets .= "<input type=\"submit\" value=\"Vai a pagina\"/>"; $rets .= "</form>"; echo $rets; } echo "</p>";
////// UNTILL HERE >>
echo "<p align="center">";echo "<a href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>";
echo "</p>";
echo "</body>";
}else if($action=="delhi5")
{
$bid = $_GET["bid"];
addonline(getuid_sid($sid),"cancella indirizzi hi5","");
echo "<head>"; echo "<title>$stitle</title>"; echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">"; echo "</head>"; echo "<body>";
echo "<p align="center">";
if(candelmd(getuid_sid($sid), $bid))
{
$res = mysql_query("DELETE FROM lirhi5 WHERE id=$bid"); if($res) { echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Hi5 cancellato<br/>"; }else{ echo "<img src=\"../notok.gif\" alt=\"x\"/>Error!<br/>"; }
}else{
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Non puoi rimuovere questo Hi5";
}
echo "<br/>";
echo "<a href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>";
echo "</p></body>";
}
else if($action=="adaugahi5")
{addvisitor();
addonline(getuid_sid($sid),"aggiunge hi5","index.php?action=$action");echo "<head>"; echo "<title>adauga hi5</title>"; echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">"; echo "</head>"; echo "<body>"; echo "<p align=\"center\">"; if(getplusses(getuid_sid($sid))<75) { echo "Devi avere almeno 75 Plus per aggiungere un indirizzo hi5!"; }else{
// alerte
$uid = getuid_sid($sid);echo "<form action=\"index.php?action=aadaugahi5&sid=$sid\" method=\"post\">"; echo "Indirizzi Hi5:<input name=\"hi5\" maxlength=\"30\"/><br/>";
// echo "Descrizione:<input name="descriere" maxlength="10000"/><br/>";
echo "<input type="submit" value="inserisci"/>";
echo "</form><br/>";
}
echo "<a href="index.php?action=hi5&sid=$sid"><img src="../images/meditatii.gif" alt=""/>Indirizzi hi5</a>";
echo "<br/><br/><a href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>";
echo "</p>";
echo "</body>";
}else if($action=="aadaugahi5")
{
$hi5 = $_POST["hi5"];
$descriere = $_POST["descriere"];
//$qut = $_POST["qut"];
addonline(getuid_sid($sid),"aggiunge indirizzi hi5","");
echo "<head>"; echo "<title>$stitle</title>"; echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">"; echo "</head>"; echo "<body>"; echo "<p align=\"center\">"; $crdate = time(); //$uid = getuid_sid($sid); $res = false; if((trim($hi5)!="")) { $res = mysql_query("INSERT INTO lirhi5 SET uid='".$uid."', adresa='".$hi5."'"); } if($res) { echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Indirizzo hi5 aggiunto"; }else{ echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Error !!!"; } echo "<br/><br/>"; echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>"; echo "</p>"; echo "</body>";
}[/PHP]