dannybrazil Posted March 18, 2010 Share Posted March 18, 2010 Hello I have this code: <?Php class carrinho_compra { function inserir_item($codi,$qtde){ $this->codigo = $codi; $this->quanti = $qtde; $this->dados = $_SESSION['carrinho_base']; if ($this->dados != "") { $this->chave = array_keys($this->dados); $this->soff = sizeof($this->chave); for ($i=0;$i<$this->soff;$i++){ if ($this->dados[$i]['codigo']==$this->codigo){ $this->dados[$i]['quanti']+=$this->quanti; $tem = 1; break; } } if ($tem != 1){ $this->dados[$this->soff]['codigo']=$this->codigo; $this->dados[$this->soff]['quanti']=$this->quanti; } $_SESSION['carrinho_base'] = NULL; $_SESSION['carrinho_base'] = $this->dados; } else { $this->dados[0]['codigo']=$this->codigo; $this->dados[0]['quanti']=$this->quanti; $_SESSION['carrinho_base'] = NULL; $_SESSION['carrinho_base'] = $this->dados; } } function excluir_item($codi){ $this->codigo = $codi; $this->dados = $_SESSION['carrinho_base']; if ($this->dados != "") { $this->chave = array_keys($this->dados); $this->soff = sizeof($this->chave); for ($i=0;$i<$this->soff;$i++){ if ($this->dados[$i]['codigo']==$this->codigo){ unset($this->dados[$i]); $this->dados1 = array_values($this->dados); $_SESSION['carrinho_base'] = NULL; $_SESSION['carrinho_base'] = $this->dados1; break; } } } } function exibir_dados(){ $this->dados = $_SESSION['carrinho_base']; if ($this->dados!="") { $this->chave = array_keys($this->dados); $this->soff = sizeof($this->chave); for ($i=0;$i<$this->soff;$i++){ $id=$this->dados[$i]['codigo']; // Connects to your Database mysql_connect("localhost", "****", "*****") or die(mysql_error()); mysql_select_db("*******") or die(mysql_error()); // Get a specific result from the "example" table $result = mysql_query("SELECT * FROM class WHERE id=$id") or die(mysql_error()); $row = mysql_fetch_array( $result ); $id=$row['id']; $type=$row['type']; $category=$row['category']; $area=$row['area']; $city=$row['city']; $street=$row['street']; $street_nm=$row['street_nm']; $bairro=$row['bairro']; $date_in=$row['date_in']; $rooms=$row['rooms']; $floor=$row['floor']; $floor_t=$row['floor_total']; $size=$row['size']; $link_for_show=$site.'show.php?id='.$id; include("array.php"); echo '<table border="0" width="800px" style="direction:rtl; margin-left:auto; margin-right:auto; background-color:#0188A6; margin-top:20px;text-align:right;">'; echo '<tr>'; echo '<td>'; $pic_1=$row['upload_1']; echo '<a href="'.$link_for_show.'" class="img_brdr" target="_self" style=" float:right;"><img border="0" src="imgsize.php?h=100&img='.$pic_1.'"/></a>'; echo '<table> <tr> <td> <div style="direction:rtl; float:right; margin-right:20px; margin-top:10px; font-size:16px; height:100px;"> <b><u>'. $type_array["type"][$type].' - '.$category_array["category"][$category].' - '.$area_array["area"][$area].'</u></b> <br> עיר: <span style="color:#FFCC66; font-weight:bold; font-size:14px; ">'.$city.'</span> <br> שכונה: <span style="color:#FFCC66; font-weight:bold;font-size:14px; ">'.$bairro.'</span> <br> רחוב: <span style="color:#FFCC66; font-weight:bold;font-size:14px; ">'.$street.' '.$street_nm.'</span> <br> תאריך כניסה: <span style="color:#FFCC66; font-weight:bold; font-size:14px;">'.$date_in.'</span> </div> </td> <td> <div style="direction:rtl; margin-right:20px; margin-top:10px; font-size:16px;height:100px;"> <b><u>פרטי הנכס</u></b><br> קומה: <span style="color:#FFCC66; font-weight:bold;font-size:14px; ">'.$floor.'</span> מתוך <span style="color:#FFCC66; font-weight:bold;font-size:14px; ">'.$floor_t.'</span> קומות <br> גודל הנכס: <span style="color:#FFCC66; font-weight:bold;font-size:14px; ">'.$size.'</span> מ"ר <br> חדרים: <span style="color:#FFCC66; font-weight:bold;font-size:14px; ">'.$rooms.'</span> <div> </td> <td> <div style=" margin-top:10px; margin-right:50px; font-size:12px;height:100px;"> <form action="myselectedads.php" method="post"> <input name="produto" value="'.$this->dados[$i]['codigo'].'" type="hidden" > <input TYPE="image" SRC="images/delete_bt.png" BORDER="0" name="acao" value="Excluir" > </form> <a href="'.$link_for_show.'" target="_self" ><img src="images/details.png" border="0" /></a> </div> </td> <tr> </table> '; echo '</td>'; echo '</tr>'; echo '</table>'; } } else { echo "<center><p> </p><p> </p><span style=\"color:#000;\">אין מודעות מסומנות במערכת</span><br><p> </p><p> </p></center>"; } } } ?> Now I have a page where I can DELETE one object from the session with this : <? session_start(); require_once('class_carrinho.php'); $carrinho = new carrinho_compra; $acao = $_REQUEST['acao']; if ($acao=='Grava') { $codi = $_REQUEST['produto']; $qtde = $_REQUEST['quantidade']; $carrinho->inserir_item($codi,$qtde); } if ($acao=='Excluir') { $codi = $_REQUEST['produto']; $carrinho->excluir_item($codi); } ?> <!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> I call it like this <form action="myselectedads.php" method="post"> <input name="produto" value="'.$this->dados[$i]['codigo'].'" type="hidden" > <input TYPE="image" SRC="images/delete_bt.png" BORDER="0" name="acao" value="Excluir" > </form> The thing is that in CHROME and MOZILA its working well 100% BUT In ie it doesnt work at all any reason ? any help? Link to comment https://forums.phpfreaks.com/topic/195672-ie-problem/ Share on other sites More sharing options...
dannybrazil Posted March 18, 2010 Author Share Posted March 18, 2010 One more thing To put it in the session its ok....the first part of the code ONLY deleting it it's NOT working in IE Link to comment https://forums.phpfreaks.com/topic/195672-ie-problem/#findComment-1028053 Share on other sites More sharing options...
dannybrazil Posted March 18, 2010 Author Share Posted March 18, 2010 I have founf something but its wierd when I send the <form> to another page to perform the felete action it works.....hmmmm I hate IE Link to comment https://forums.phpfreaks.com/topic/195672-ie-problem/#findComment-1028060 Share on other sites More sharing options...
dannybrazil Posted March 18, 2010 Author Share Posted March 18, 2010 I though it works but it doesnt Any known problems with ie and cookies? Link to comment https://forums.phpfreaks.com/topic/195672-ie-problem/#findComment-1028231 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.