Jump to content

nepoverljiv

Members
  • Posts

    16
  • Joined

  • Last visited

Everything posted by nepoverljiv

  1. I have problem with seo friendly url. I've try to change my url with .htaccess and off course I have problem. My link in header for my contact page is like this: <a href="index.php?=contact">contact</a> So I wrote rules in .htaccess like this: Options +FollowSymLinks RewriteEngine On RewriteRule ^contact index.php?=contact And off course changed my link in header to be like this: <a href="contact">contact</a> And now when I click on contact on header I get nice url like this: www.mywebsite.com/contact But website lead me always to home page (index.php). What I did wrong?
  2. I try like this: $array=$_POST['pid']; $id_str_array = explode(",", $array); // Uses Comma(,) as delimiter(break point) $fullAmount = 0; foreach ($id_str_array as $key => $value) { $id_quantity_pair = explode("-", $value); // Uses Hyphen(-) as delimiter to separate product ID from its quantity $product_id = $id_quantity_pair[0]; // Get the product ID $product_quantity = $id_quantity_pair[1]; // Get the quantity $sql = mysql_query("SELECT * FROM mytable WHERE id='$product_id' LIMIT 1"); while($row = mysql_fetch_array($sql)){ $product_price = $row["price"]; echo $product_price; //show all price } $product_price = $product_price * $product_quantity; $fullAmount = $fullAmount + $product_price; } Where I wrote show all price, I printing all price, but if I add also id to print, he will print me only id for every article or only price for each article depends what I first echo. Can anyone help me with this, because I am close to finish?
  3. Hi, I make some code and almost finish my shopping cart on website. Just need finally touch . Ok, I have problem on last page, problem is like this. When someone click to order what he putted in shopping cart, on one page I wanna list everything what he ordered an send on e-mail. Trick is I don't have only id in array, I have almost quantity. For example, if someone order article with id=1 and quantity 3, and article with id=2 and quantity 4, and article with id=3 and quantity 2. On my page I get all that in array like this: $array=$_POST['id']; When I print that I get this: 1-3,2-4,3-2 How to I get from my table "description", list of every article in this example and immediately multiply them price with quantity? I try something with: $id_quantity_pair = explode("-", $array); // Uses Hyphen(-) as delimiter to separate product ID from its quantity $product_id = $id_quantity_pair[0]; // Get the product ID $product_quantity = $id_quantity_pair[1]; But I dont know how to put that in list, I know only to working with array with one value. Anyone to help me?
  4. U can see online www.vuna.034.rs. On right side you can see "U korpu" (add to cart) , and you will see what will happen
  5. I wanna get in my shopping cart this: 1.Name of first articles - Price of first articles After I add one more wanna get this: 1.Name of first articles - Price of first articles 2.Name of second articles - Price of second articles But instead that I get this: 1.Name of first articles - Price of first articles 2.Name of first articles - Price of first articles After I add one more wanna get this: 1.Name of first articles - Price of first articles 2.Name of first articles - Price of first articles 3.Name of second articles - Price of second articles 4.Name of second articles - Price of second articles I am using exactly same code on another website and there working ok, I can't figured it out why happen this on new one sites.
  6. I have figured it out that problem is in this line of code: $sql="SELECT * FROM $tbl_name WHERE id=$element"; $subject_set=mysql_query($sql); $subject=mysql_fetch_array($subject_set); Everything before is ok, but here give me double values. Please help me
  7. I have one code which I use to add articles in shopping cart. In another website working without any kind of problem, but on new one he makes me problem, he add me double article in shopping cart. I press once “add to basket” but he put me twice that articles. When I press “add to basket” I calling this code to found out which articles is: <?php session_start(); $var=$_SERVER['REQUEST_URI']; //reading $id = substr(strrchr($var, "korpa?"),6 );//reading first element after "?" $tbl_name="description"; //table name $_SESSION['korpa']+=$row[price]; if($_SESSION['numproduct']==0){ $_SESSION['articles']=array($id); $_SESSION[numproduct]++; }else{ array_push($_SESSION['articles'],$id); $_SESSION[numproduct]++; } redirect("javascript: history.go(-1)"); ?> On main page I using this code to see what exist in shopping cart: $i=0; $tbl_name="description"; $query = count($_SESSION['articles']); if($query==0){ echo "Your shopping cart is empty."; }else{ echo "In your shopping cart exist:<br/><br/>"; for($i=0;$i<=$query-1;$i++){ $br=$i+1; connect(); $element=$_SESSION['articles'][$i]; $sql="SELECT * FROM $tbl_name WHERE id=$element"; $subject_set=mysql_query($sql); $subject=mysql_fetch_array($subject_set); echo " ".$br.". "; echo $subject['name']; echo " - <b>".$subject['prices']." USD</b><br/> "; } echo "<p align=right><a href=index.php?=order class=basket>Order</a> · <a href=includes/delete.php>Delete items</a></p>"; Does anyone knows why articles goes twice in shopping cart?
  8. But I don't have just one column, I have 4. How to write right name when I have 4 name. How to which name is right?
  9. Not work. I try $proba = mysql_query("SELECT column FROM filmovi WHERE MATCH('genres1','genres2','genres3','genres4') AGAINST ('Action')"); What can be problem, and what SELECT column FROM means?
  10. How to search 4 columns for one words. I can't with OR because isn't good for my search. I need to look in columns : genres1, genres2, genre3, genres4; are they have on particularly word. Can anyone help me with this? Are can maybe with MATCH?
  11. And answer is: <?php // Getting the Contents of page REMOVED ?>
  12. Because you dont wanna show me how to scrape IMDB. Show me how to scrape this site, and I use that way of scraping on other site I wanna.
  13. Ok, can u then help me to scrape this page http://www.megaracunari.com/index.php?=detalji70. Here I have permission because this is mine site. How to scrape data after words Tip procesora, Procesor, Memorija?
  14. Hi everyone, I need help with scraping. I have script for scraping IMDB, but I need a few more thing. I dont know how to scrape more Budget, Opening Weekend, and Gross. Rest information that I need I scrape on this way: //code removed to discourage people from scraping IMDB Can somebody help me to scrape Budget, Opening Weekend and Gross also?
  15. Anyone can help me? <?php $tbl_name="menu"; $kategorije = mysql_query("SELECT * FROM $tbl_name WHERE Left(menu_name, 1) BETWEEN 'A' AND 'M' ORDER BY menu_name ASC"); if (!$kategorije) { die("Database query failed: " . mysql_error()); } while ($row=mysql_fetch_array( $kategorije )) { echo "<div id=lista-header><h4>{$row["menu_name"]}</h4></div>"; $id_sub=$row['id_menu']; $podkategorije = mysql_query("SELECT * FROM submenu WHERE id_menu=$id_sub ORDER BY sub_name ASC", $connection); if (!$podkategorije) { die("Database query failed: " . mysql_error()); } echo "<ul class=\"pod\">"; while ($pod=mysql_fetch_array( $podkategorije )) { echo "<li><a href=index.php?=podkate?".$pod["id_sub"]." class=black>{$pod["sub_name"]}</a><hr size=1 align=left width=100px color=#cccccc></li>"; } echo "</ul>"; } ?> In this way, I get list with categories and hes subcategories. How to count how many subcategories have each categories, and count how many articles have each categories? Example (I wanna get this kind of look): Categories name (3) subcategoriesname (2) subcategoriesname (4) subcategoriesname (7) Categories name (5) subcategoriesname (1) subcategoriesname (14) subcategoriesname (9) subcategoriesname (2) subcategoriesname ( Categories name (2) subcategoriesname (28) subcategoriesname (17) Where the numbers represent how many categories and sub-items have articles
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.