Jump to content


  • Posts

  • Joined

  • Last visited

7blake's Achievements


Newbie (1/5)



  1. Hi Just an outside point of view so I'm not sure if this is at standards, but how are people being made aware of your website? It looks more like a tool, so how are people coming across it? The main thing is you want clients to come to your site, so why/how are they finding out about this site? This is more of a communication issue, connecting the sites capability to the right audience, knowing how to get the right people to the right place. Perhaps the site is fully functional with the use of a database and php coding, but you're missing massive elements when it comes to communicating to regular people, and without sounding rude, the design makes me feel a bit uneasy. Could be why it's not being utilized, because I don't see something like this being searched for right off the bat. Generalized comparisons are not easy to set up off the bat, it would be better to grow your site into a platform that does product/brand listings/comparisons. But starting off just like that, you basically need a user who is looking to do product search. You really need a reputation or some anchoring elements for this to work in my opinion. Though, if you leading people from an already existing platform, and then to this site, but no one is using it, then it would be purely a design issue. Because the site doesn't really make any sense to me the way it's designed. Essentially it's just a barebones tool and the driving element is a user who knows exactly what they want when utilizing it. I'd suggest re-assessing what you are aiming for with the website, and communicating with a designer and marketing group to chisel it out properly. But.... where are you getting the massive amount of data to back up the challenge you are setting for yourself by creating a tool(website) like this? Can you explain what this website offers to the user, and what your overall objective is? Because, it's so general, it seems like you are aiming to show product listings from.. what? All online sources? Which sources? I'd say it's definitely not realized properly unless it's attached to the primary ecommerce website, to which there is no presence on this site.
  2. Yes thankyou both @Brand - IThanks for clarifying and supplying the correct way. I appreciate it. I was using the foreach on the Value, not the Key from the outer object. Bah. Thanks! @nik_jain - Thankyou for that bit of information. That's a pretty crucial fork in the road. Cheers
  3. basic ajax/php relationship below. You could set it up, and then have it on a timed loop function, if you need it to run during a specific set of time. It just needs some tweaking depending on the sort of data you are sending, but the overall base structure is there. $.ajax({ method: "POST", // Or GET url: 'path', // URL to your server page data: {parameter1: value1}, // parameters -- can be multiple. pareameter1 is what you target with $_POST['parameter1'] in PHP - value1 is your data. success: function(data) { // PHP's echoed data // Do something with the echoed data } //php if(isset($_POST['param1])){ $retrievedData = $_POST['parameter1']; echo $retrievedData; } });
  4. I'm grabbing an object with objects that is converted to JSON, then decoded in PHP newObject = {"firstObject":{"Color" : "red"}, "secondObject":{"Color":"blue"}}; anyhow, I can get this to PHP fine, and access it with the foreach loops. But I can't access "firstObject" or "secondObject". $someArray = json_decode($_POST['containerPositions'], true); foreach($someArray as $value){ foreach ($value as $secondKey){ echo getClass($value) . " " . $secondKey;} } Could someone tell me what is the correct method for accessing them?
  5. I'm grabbing an object with objects that is converted to JSON, then decoded in PHP newObject = {"firstObject":{"Color" : "red"}, "secondObject":{"Color":"blue"}}; anyhow, I can get this to PHP fine, and access it with the foreach loops. But I can't access "firstObject" or "secondObject". $someArray = json_decode($_POST['containerPositions'], true); foreach($someArray as $value){ foreach ($value as $secondKey){ echo getClass($value) . " " . $secondKey;} } Could someone tell me what is the correct method for accessing them?
  6. Ah, my apologies. if I could correct my statement I would. (too late to edit) Thanks iThinkMyBrainHurts
  7. Thanks alot, got the ball rolling So incase anyones new and interested too, to capture the dynamic state of the HTML you only need var x = $("body").html(); alert(x); To capture the saved state of a file and send via aJax $.ajax({ url: "fileName.php", type: "POST", dataType: "text", success: function(data) { alert(data); } }); I'm not sure how to capture dynamic variables in Javascript though. I suppose it just needs a script to update an array, then send the array that way. Thanks for the info maxxd
  8. Hi. Not too sure how to word this right. I remember once when I was learning how to send javascript variables to PHP, I accidentally sent a capture of the entire index.php. Ive been trying to find the answer online but I guess im not wording it right. Does anyone know how to do this?
  9. Yar i found it. I was using javascripts .replace to clear the 'url(http://localhost/' portion earlier. But I had two quotes, so it was effectively doing what I wrote it to do.. nothing. Thanks for the perk up. This had nothing to do with PHP, Ill ask a mod to delete or move this thread. And Ill read your suggestion eventually. My heads a bit preoccupied at the moment. It looks simple, but vital if I intend to actually build sturdy secure infrastructure. It's appriciated. Take care
  10. For real? I had to put $item_id = str_replace("url(http://localhost/Online/inventory_images/", "", $item_id); $item_id = str_replace(".jpg)", "", $item_id); Into each one of my functions that called the ID from each item of the cart. Well, guess that solves that problem for now.
  11. Probably a stupid question. Just a bit unsure.. I wish they'd regulate primary "language" throughout their browsers. Though I guess no one wants to conform to the other, which is fair... So what do I do? I can fix the URL issue with $item_id = str_replace("url(http://localhost/Online/inventory_images/", "", $item_id); $item_id = str_replace(".jpg)", "", $item_id); But this seems stupid. Why is it doing that? Is this normal? And what is wrong with my $product_name... it's not registering
  12. Hi, I'm not sure where the problem is here. Right now this site works fine in IE and FF, but then I try to load data from the database into the cart, it get's screwed up in Chroms and Safari. FF loads <img src="inventory_images/11.jpg" alt="Some item" id="11" class="cartImages" border="1"> While Chrome loads this <img src="inventory_images/url(http://localhost/Online/inventory_images/11.jpg).jpg" alt="" id="url(http://localhost/Online/inventory_images/11.jpg)" class="cartImages" border="1"> From this if(isset($_POST['miniCartRequest'])){ include "/storescript/connect_to_mysql.php"; $cartOutput = ""; $cartTotal = ""; $product_name=""; $price=""; if(!isset($_SESSION['cart']) || count($_SESSION['cart'])<1){ $cartOutput = "<h2 align='center' style='color:white;'>Your cart is empty</h2>"; } else { $i = 0; foreach($_SESSION['cart'] as $each_item){ $item_id = $each_item['item_id']; $sql = $mysqli->query("SELECT * FROM products WHERE id='$item_id' LIMIT 1"); while($row = $sql->fetch_array()){ $product_name = $row['product_name']; $price = $row['price']; $details = $row['details']; $size = $row['size']; } $pricetotal = $price*$each_item['quantity']; $cartTotal = $pricetotal + $cartTotal; setLocale(LC_ALL, 'en_GB.utf8', 'en_GB'); $pricetotal = number_format($pricetotal, 2); $x = $i + 1; $cartOutput .= "<img src='inventory_images/" . $item_id . ".jpg' alt='" . $product_name . "' id='" . $item_id . "' class='cartImages' border='1' />"; $i++; } } echo $cartOutput; } Can I create an alternative line of code specificall for Chrome/safari to remove the excess characters? And why exactly are they reading the files with the full source locations vs firefox reading only the local location? It's completely unable to read the $product_name aswell. A bit strange, I take it those browsers process the specific information differently?
  13. Oh man.. thankyou very much for explaining that. I was just on the tail of figuring that out. Very much appriciated for the information and time. if(isset($_POST['mainCartDelete'])){ $cartArray = $_SESSION['cart_array']; $test = ""; foreach($cartArray as $key => $item) { $test .= $key . " "; if($key == 21){ unset($_SESSION['cart_array'][$key]); } } echo $test; }
  14. HI, I'm having trouble with unsetting a key from SESSION. I can unset the cart, but when I try to target the key, it doesn't work. Are there some regular things I should be looking for? The only thing I can think of is that I'm re-initializing the key by accident elsewhere in my code. if(isset($_POST['mainCartDelete'])){ unset($_SESSION['cart_array'][21]); $sessionArray = $_SESSION['cart_array']; print_r ($sessionArray); } Print_r returns Array ( [0] => Array ( [item_id] => 21 [quantity] => 1 ) )
  • 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.