Search the Community
Showing results for tags 'bug'.
-
This code works without problems: <?php namespace NamespaceA; class A extends \NamespaceB\B {} namespace NamespaceB; class B {} But why the following code cause Fatal error: Class 'NamespaceB\B' not found in ...file? <?php namespace NamespaceA; class A extends \NamespaceB\B {} namespace NamespaceB; class B extends \NamespaceC\C {} namespace NamespaceC; class C {} And this code also works without problems: <?php namespace NamespaceA; class A extends \NamespaceB\B {} namespace NamespaceC; class C {} namespace NamespaceB; class B extends \NamespaceC\C {} Without any namespace, also Fatal error: Class 'B' not found in ...file: <?php class A extends B {} class B extends C {} class C {} Works without problems: <?php class A extends B {} class B {} And yes everything is in the same PHP file....
-
I found this bug in phpMyAdmin: phpMyAdmin - Errorindex.php: Missing parameter: import_type<a href="./doc/html/faq.html#faqmissingparameters" target="documentation"><img src="themes/dot.gif" title="Documentation" alt="Documentation" class="icon ic_b_help" /></a> index.php: Missing parameter: format<a href="./doc/html/faq.html#faqmissingparameters" target="documentation"><img src="themes/dot.gif" title="Documentation" alt="Documentation" class="icon ic_b_help" /></a> What I did to find it: log in run an SQL statement let the session expire log back in hello ERROR!!!!!
- 1 reply
-
- phpmyadmin
- bug
-
(and 2 more)
Tagged with:
-
Hi guys, i'm developing a simple shopping cart for a website. Everythings worked great, until i decided to make a mod in order to switch type of article token from db. Now here's the bug: every time i try to delete an item from cart, it deletes every item but the first one in the cart. Even if the quantity is more than 1... Please, help me to find this bug.. it's about 4 days that i try to solve it. Sorry for my bad english, and thank you for your help. You can't find the website here and check the bug -> http://www.pizzainncasa.com/SitoGennaio/Sito/ordinaonline.php?&request=Pizza This is my code: ordinaonline.php (shoponline.php in english) <?php session_start(); include_once("config.php"); $request = $_GET['request']; ?> ||HTML.............|| <h1>Articoli </h1><hr><h4>Seleziona una categoria dal menù in alto per visualizzare i prodotti!</h4><br><br> <div class="products"> <?php //current URL of the Page. cart_update.php redirects back to this URL $current_url = base64_encode($url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); $results = $mysqli->query("SELECT * FROM Articoli WHERE Tipo = '$request' ORDER BY ID ASC"); if ($results) { //risultati dal db while($obj = $results->fetch_object()) { echo '<div class="product">'; echo '<form method="post" action="cart_update.php">'; //<img src="images/'.$obj->product_img_name.'" ></div>'; if($obj->product_img_name!=""){echo '<div class="product-thumb"><img width="200" height="100" src="images/'.$obj->product_img_name.'" ></div>';} echo '<div class="product-content"><h4>'.$obj->Nome.'</h4>'; echo '<div class="product-info">Prezzo '.$currency.$obj->Prezzo.' <button class="add_to_cart">Aggiungi al carrello</button></div>'; echo '</div>'; echo '<input type="hidden" name="product_code" value="'.$obj->ID.'" />'; echo '<input type="hidden" name="type" value="add" />'; echo '<input type="hidden" name="return_url" value="'.$current_url.'" />'; echo '</form>'; echo '</div>'; } } ?> </div> <div class="shopping-cart"> <h2>Il tuo carrello</h2> <?php if(isset($_SESSION["products"])) { $total = 0; echo '<ol>'; foreach ($_SESSION["products"] as $cart_itm) { echo ("removing ".$_SESSION['removing']); echo '<li class="cart-itm">'; echo '<span class="remove-itm"><a href="cart_update.php?removep='.$cart_itm["code"].'&return_url='.$current_url.'">×</a></span>'; echo '<h3>'.$cart_itm["name"].'</h3>'; echo $cart_itm['code']; echo ('added -> '.$_SESSION['test']); echo '<div class="p-qty">Quantita : '.$cart_itm["qty"].'</div>'; echo '<div class="p-price">Prezzo € :' .$cart_itm["price"].'</div>'; echo '</li>'; $subtotal = ($cart_itm["price"]*$cart_itm["qty"]); $total = ($total + $subtotal); } echo '</ol>'; echo '<span class="check-out-txt"><strong>Totale € : '.$total.'</strong> <a href="view_cart.php">Invia l\'ordine!</a></span>'; }else{ echo 'Il tuo carrello è vuoto'; } ?> </div> </div> [html............] and this is the cart_update.php [php]<?php session_start(); include_once("config.php"); //aggiunge un articolo al carrello if(isset($_POST["type"]) && $_POST["type"]=='add') { $product_code = filter_var($_POST["product_code"], FILTER_SANITIZE_STRING); //salva il product code $return_url = base64_decode($_POST["return_url"]); // salva il return url $_SESSION['test'] = $product_code; //MySqli query - prende le informazioni sull'oggetto dal db utilizzando il product_code $results = $mysqli->query("SELECT Nome,Prezzo FROM Articoli WHERE ID='$product_code' LIMIT 1"); $obj = $results->fetch_object(); if ($results) { //abbiamo le informazioni sugli articoli //prepara l'array per la sessione $new_product = array(array('name'=>$obj->Nome, 'code'=>$product_code, 'qty'=>1, 'price'=>$obj->Prezzo)); if(isset($_SESSION["products"])) //se la sessione esiste { $found = false; //setta found a false foreach ($_SESSION["products"] as $cart_itm) //scorre tutto l'array della sessione { if($cart_itm["code"] == $product_code){ //allora l'articolo è nell'array della sessione $qty = $cart_itm["qty"]+1; //aumenta la quantità dell'articolo $product[] = array('name'=>$cart_itm["name"], 'code'=>$cart_itm["code"], 'qty'=>$qty, 'price'=>$cart_itm["price"]); $found = true; }else{ //l'articolo non esiste, prendi le info vecchie e prepara l'array per la sessione $product[] = array('name'=>$cart_itm["name"], 'code'=>$cart_itm["code"], 'qty'=>$cart_itm["qty"], 'price'=>$cart_itm["price"]); } } if($found == false) //allora non abbiamo trovato l'articolo nell'array della sessione { //aggiungi un nuovo articolo nell'array della sessione $_SESSION["products"] = array_merge($product, $new_product); }else{ //abbiamo trovato l'articolo e abbiamo aumentato la quantità $_SESSION["products"] = $product; } }else{ //crea una nuova variabile sessione se non esiste $_SESSION["products"] = $new_product; } } //ritorna indietro alla pagina iniziale header('Location:'.$return_url); } //rimuovi un articolo dallo shopping cart if(isset($_GET["removep"]) && isset($_GET["return_url"]) && isset($_SESSION["products"])) { $product_code = $_GET["removep"]; //ottieni il codice prodotto dell'articolo da rimuovere $return_url = base64_decode($_GET["return_url"]); //ottieni l'url di ritorno foreach ($_SESSION["products"] as $cart_itm) //scorre tutto l'array della sessione { if($cart_itm["code"]==$product_code) //forse l'errore è qui { //allora l'articolo è nell'array della sessione $_SESSION['removing']=$cart_itm["code"]." ".$product_code; //continua solo se la quantità è >1 //rimuovendo quello che ha quantità 0 if($cart_itm['qty']>1) { $cart_itm['qty']-=1; } }else{ $product[] = array('name'=>$cart_itm["name"], 'code'=>$cart_itm["code"], 'qty'=>$cart_itm["qty"], 'price'=>$cart_itm["price"]); } //setta la sessione con i valori nuovi ----> PROBABILE ERRORE IN QUESTA SEZIONE <------ $_SESSION["products"] = $product; $product= array(); } //ritorna indietro header('Location:'.$return_url); } ?>
- 1 reply
-
- php mysql bug
- php
-
(and 3 more)
Tagged with:
-
I have received 3 "xxx likes your post" notifications yet the count displayed in my profile on reflects 2.
-
Just discovered what I'm pretty sure is a bug with the new URL rewrite rules: http://forums.phpfreaks.com/topic/268690-problem-in-connecting-to-sql-server-2008-by-php/unread/ That link gives me the default ngnix 404 page, as pasted below. Even I try to remove the /unread/ part it still shows the below 404 error, and if I try to remove the -php bit the script identifies the correct thread, and redirects me to the above URL anyway. If I remove the entire title, and leave only the topid ID, I get the forum "Can't find this thread" message. Considering that the keyword seems to be the "php" at the end of the title, I suspect an incorrect quantifier or faulty boundary check. <html> <head><title>404 Not Found</title></head> <body bgcolor="white"> <center><h1>404 Not Found</h1></center> <hr><center>nginx</center> </body> </html>
- 2 replies
-
- bug
- url_rewrite
-
(and 3 more)
Tagged with: