Jump to content

gdfhghjdfghgfhf

Members
  • Posts

    218
  • Joined

  • Last visited

Everything posted by gdfhghjdfghgfhf

  1. Weird... my browser didn't find any results when i was searching for "38" in the XML file.... Sorry about the dumb question then...
  2. I wrote a script to check a remote xml file for the stock state of some products. I want to list all sizes ID having "available"=true and "appearance id"=2 the expected result should be but i'm getting where the hell does this "38" comes from ? Here's the script: <?php $checkstockcolor = "2"; $apiurl = "http://api.spreadshirt.com/api/v1/shops/266497/productTypes/175"; $feed = simplexml_load_file($apiurl); $producttype = $feed->productType; $stockstate = $feed->stockStates->stockState; foreach ($stockstate as $stock) { $available = $stock->available; $stockcolor = $stock->appearance[id]; $size = $stock->size[id]; // garder uniquement les résultats de la couleur présentement sélectionnée if ($stockcolor == $checkstockcolor && $available == "true") { echo "$size<br>"; } } ?> Thank you !
  3. Update again: it was just a problem with a quote. I fixed it, now the script *seems* to send the data (at least it doesnt reload the page) But after clicking the submit button, the basket is still empty When sending the form, a product is supposed to be added to the basket here: https://nidieunimaitre.spreadshirt.com/shop/basket/ It works when i use a normal form, but doesn't work when i try to submit with AJAX
  4. I have tried following this tutorial: http://www.simonerodriguez.com/ajax-form-submit-example/ But it's not working I don't understand what i'm doing wrong <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script src="scripts/ajaxsbmt.js" type="text/javascript"></script> </head> <body> <form name="MyForm" action="https://nidieunimaitre.spreadshirt.com/shop/basket/addtobasket" method="post" onsubmit="xmlhttpPost('https://nidieunimaitre.spreadshirt.com/shop/basket/addtobasket, 'MyForm', 'MyResult', '<img src=\'pleasewait.gif\'>'); return false;"> <input type="hidden" name="product" id="productId" value="101894422"/> <input type="hidden" name="article" id="articleId" value="10568008"/> <input type="hidden" name="view" id="currentView10568008" value="351"/> <input type="hidden" name="color" id="productColor10568008" value="2"/> Size <select class="b-core-ui-select__select" id="size" name="size"><option value="2" >S</option><option selected value="3" >M</option><option value="4" >L</option><option value="5" >XL</option><option value="6" >XXL</option></select> <br> Quantity <select class="b-core-ui-select__select" id="quantity" name="quantity"> <option selected value="1" >1</option> <option value="2" >2</option> </select> <br> <input name="send_button" type="submit" value="Send" /> </form> <div id="MyResult"></div> </body> </html>
  5. i'm a little bit confused... i'm a newbie with AJAX and never really used it... could you give me a working example to submit the form i posted ? i would really appreciate ! thanks a lot
  6. For some reason i need to submit a form to an external website without changing the page. I'm a newbie with AJAX and i don't know how to do it so i would really appreciate if someone could help me. Here's the form i need to submit: Thanks a lot !
  7. Well when i look in phpmyadmin the accents aren't correctly displayed "é" are displayed as "é" in the database so i don't think the problem is about output... I also have other strings with accents on the same page and they are correctly displayed. I only have a problem with accents coming from SQL. I also tryed without utf8_encode()
  8. I'm trying to add text into a mysql field containing french accents "é" will end up as "é" How can i fix that ? My sql field is already set to utf8 and i'm running utf8_encode() on the value i'm adding to SQL... what's wrong ? Thanks
  9. Here's my SQL structure: [category] [article_id] [name] 1 27487 dog 2 445343 cat 3 445345 fish 1 43253 horse 2 543435 bird i'm trying to query only the entries who have unique category ID. With the above example i would expect this result: [category] [article_id] [name] 1 27487 dog 2 445343 cat 3 445345 fish How can i do that ? I tryed using DISTINCT and GROUP BY, looks easy to do when you have only 1 field but i don't know how to use it in my situation... If i use DISTINCT it will look for unique rows on the 3 fields... I want to look for unique rows only for "category" field (the entry shouldnt be considered as unique as soon as the category ID has been found in another entry previously) I hope you can understand what i'm trying to do :/
  10. Yes but they won't be linked to my t-shirt supplier. I just want to hide where the tshirts are printed.
  11. Yes. This is my website. Here's my situation: I have a spreadshirt t-shirt shop hosted on Spreadshirt.com. I'm building a php website to display my shop on my own website using their API, so the users will think it's my own shop. But the images are still hosted on Spreadshirt.com If the users know the shop comes from Spreadshirt, they can just copy my images and make their own t-shirts from my supplier. I think i may just consider taking the binaries from the images and storing it in my database as Blob
  12. That's what i meant by "hiding" the real URL. But the way i am doing it, the server must load the content of the image before displaying it to the user and it makes the page loading time longer... Is there a better way ? I don't care if the users download the image. I just don't want them to know where it's coming from. I want them to think the image is hosted on my server, not on a remote website.
  13. I'm looking for a way to hide the URL of the remote images included in one of my page. I've done that : But it makes the loading of the page really slower because the image needs to be loaded on my server before being displayed to the users... So i'm looking for a faster way to do it... Any idea ? Maybe with htaccess ?
  14. I am displaying an external page on my website with file_get_contents() so i have no control over the text. But i need to move a string to a different location in the page. I have tried with preg_replace but it's not working. I think it's because the distance between the wildcard delimiter is too long. After moving the string, i also need to add <img> tags around it My page looks like this : (lots of html code here) <input type="hidden" name="product" value="20842421" /> (lots of html code here) <div class="articleSize"> (lots of html code here) <input type="hidden" name="product" value="20842422" /> (lots of html code here) <div class="articleSize"> (lots of html code here) The result i am expecting would be : (lots of html code here) <input type="hidden" name="product" value="20842421" /> (lots of html code here) <img src="20842421.gif"> <div class="articleSize"> (lots of html code here) <input type="hidden" name="product" value="20842422" /> (lots of html code here) <img src="20842422.gif"> <div class="articleSize"> (lots of html code here) I have over 60 different different matches to move on this page Any help would be appreciated
  15. Thanks a lot ! Did exactly what i wanted
  16. $tshirt is the name of articles followed by a code "A123456789". The code is random numbers but always begin by "-A" I'm trying to get the name of the article WITHOUT the number code Here's the code i am currently using: $tshirt = "Name-of-the-tshirt-A123456789"; $categorie = explode("-A", $tshirt); $categorie = $categorie[0]; echo $categorie; Problem with this code is that it is bugged if the article looks like this : $tshirt = "tshirt-anime-A123456789"; Then the result will be "tshirt" when it's supposed to be "tshirt-anime" How can i add some sort of wildcard to be sure that "-A" is followed by a number ? Thanks
  17. i already have a code to do that... problem is that it will also convert existing links
  18. i'm trying to convert all URL to links i'm currently using this code: <?php $str = "http://www.i-want-to-convert-this.com <br> <a href=\"http://www.this-link-is-already-converted.com/i-dont-want-to-convert-it.html\">Don't convert this !</a>"; $str = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\0\" rel=\"nofollow\">\\0</a>", $str); echo $str; ?> but this code is also converting URL that are already linked with the <a href> tag can someone help me to modify this code to convert only URL without the <a href> tag ?? thanks a lot!
  19. I'm stuck at the same place because no one is helping me... I could already manage to get a working code to do 50% of what i need, now i just need the other 50% ...and posts like this aren't helping me... its not like if i'm begging for a code, i already searched and got a very good start to do what i want. No... just take a look at my first post i explained everything... My code will add [DL] and [/DL] tags to links having the <a href> html tags. But i would also want to replace links without <a href> tags (see exemple given in first post)
  20. i have tryed what i posted in my first post. but i can't get it to work also with the <a href=""></a> tags
  21. thanks, i got it working now ! i tryed with html_entities_decode before but it didn't work, i don't understand why it works now... probably done something wrong when i first tryed it
×
×
  • 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.