Jump to content

Rusty3

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Everything posted by Rusty3

  1. I think I just did: http://www.phantomjs.org
  2. Thanks quasiman. The problem is that I can't do a successful CURL POST request.
  3. Still couldn't find a way around this...
  4. Using base64_encode to encode the name of a major function on your code and them shift the values to reach non printable chars. This way, when a newbie tries to temper your code, opening it on a editor, it will fail to run when saved! What do you think?
  5. Thanks for the idea kickstart, let me test it out...
  6. Hello. Any way to do this on a single Update query? I mean I have rows with many many columns and would like to update only the values that are NULL. Can I use IFNULL? var1 = NULL var2 = C UPDATE myvariables SET var1=A, var2=B (...) WHERE id=100 I want var1 to be updated, but var2 to be left intact. I am sure this is recurring problem. Thanks for any clue.
  7. No clues? No Javascript expert on board? Thanks.
  8. Thanks spfoonnewb, the snippet I posted was wrong, but that was not the problem. The problem is that now Godaddy inserts a random string and a random parameter ("rnd" and "nblPLWxHGVnEAfbPcBZp") when searching their auctions page. I hit godaddy.com first (to create the session and store it on the same cookie) but it doesn't work. Any ideas on how to simulate the behavior they do on the complex Javascripts they run? $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.02; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__).'/godaddycokie.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__).'/godaddycokie.txt'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_URL, 'https://auctions.godaddy.com'); curl_exec($ch); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, 't=16&action=search&hidAdvSearch=ddlAdvKeyword:3|txtKeyword:|ddlCharacters:0|txtCharacters:|txtMinTraffic:|txtMaxTraffic:|txtMinPrice:|txtMaxPrice:|ddlCategories:0|chkAddBuyNow:false|chkAddFeatured:false|chkAddDash:true|chkAddDigit:true|chkAddWeb:false|chkAddAppr:false|chkAddInv:false|ddlPattern1:-|ddlPattern2:-|ddlPattern3:-|ddlPattern4:-|chkSaleOffer:false|chkSalePublic:false|chkSaleExpired:true|chkSaleCloseouts:false|chkSaleUsed:false|chkAddOnSale:false|ddlAdvBids:0|txtBids:|txtAuctionID:|chkTLD1:false|chkTLD2:false|chkTLD3:false|chkTLD4:false|chkTLD5:false|chkTLD6:false|chkTLD7:false|chkTLD233:false|chkTLD240:false|chkTLD251:false|chkTLD292:false|chkTLD69:false|chkTLD22:false|chkTLD85:false|chkTLD396:false|chkTLD51:false|chkTLD50:false|chkTLD465:false|chkTLD466:false|chkTLD80:false|chkTLD366:false|chkTLD62:false|chkTLD205:false|ddlDateOffset:&rpp=15&page=1&pageMode=2&rnd=0.4006484983301911&nblPLWxHGVnEAfbPcBZp=74091bb5e79d499aa8e591b57ed932bb'); curl_setopt($ch, CURLOPT_URL, 'https://auctions.godaddy.com/trpSearchResults.aspx'); $response = curl_exec($ch); if ($response === false) { echo curl_error($ch);} else { echo "Response OK:$response";}
  9. Thanks jcbones, but I am not inside Godaddy (hosting). I am outside (from any other hosting) simply trying to load a page...
  10. For the first time in my life, I can't open a webpage with curl: $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); //curl_setopt($ch, CURLOPT_SSLVERSION, 3); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.02; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__).'/godaddycokie.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__).'/godaddycokie.txt'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $url = 'https://auctions.godaddy.com'; curl_setopt($ch, CURLOPT_REFERER, $url); echo curl_exec($ch); Any clues? Some Javascript trick?!
  11. Thanks corbin. So there's nothing wrong with the code... I can't because one depends on the results of the first one. When run alone both are very fast. When together, I get a 500!
  12. I get 500 over and over from server before getting a successful one. Db is not that big. Any clue greatly appreciated. $query="SELECT * FROM table1 WHERE condition"; $results=mysql_query($query); while($row = mysql_fetch_array($results, MYSQL_ASSOC)) { $query2="SELECT * FROM table2 WHERE condition2"; $results2=mysql_query($query2);
  13. Yes, that's the solution I was thinking about. A lock file or a lock key on the db. Cron would call a control php to do that, with a timeout of 59sec.
  14. How do you run the AJAX code? Via a cron job or what? Good question.
  15. kratsg: yes, I think there's a way of cron not running a script that its already running and if a cron is called every second, it would work. But its not an elegant solution...
  16. The script triggering its own refresh! Very clever. Will try it out... Wait a minute, it won't cut the cheese! Instead of $timeOut, I tought about putting the refresh test on the main loop, but its eating its own tale. If script is dead, loop will not go on, refresh will not be triggered ...
  17. Thanks for the reply. I don't see how ajax could make a difference?! But,maybe, that's me. Yes, db, array, the usual stuff. Flushing it to keep sending output. I also wonder how to detect when to reload it. Sometimes php scripts stop responding and running but still show up as alive. Till they are killed... but then I would not be keeping it continuosly running....
  18. What's the best way of doing it? (with set_time_limit already to max) Say I want to keep it running for 4 or 5 hours. Running it from shell with "nohup nice"? Also, how to detect it stalled and restant it? Controling "ps" id on the shell?
  19. wow, you're right. Your function is brazzing fast!!! Thanks, thanks. Where's the Thank You / rep / anything button?
  20. Found the source: (I think) http://www.fullposter.com/snippets.php?snippet=40
  21. Now I found this code snippet somewhere (I think it was on php.net) and have used it on my scripts, however, today I have found it is buggy!!! This code autopads an array: function autopad($array=array(), $length=0){ $length=abs((int)$length); if($length<=sizeof($array)){return $array;}; $originalSize=sizeof($array); while(sizeof($array)<$length){ $addQuantity=$length - sizeof($array); if($addQuantity<$originalSize){$originalSize=$addQuantity;}; $array=array_merge($array, array_slice($array, 0, $originalSize)); } return $array; } Now, this works fine: $arr = array("one","two","three","one","two","three","one","two","three","one","two"); $arr = autopad($arr, 30000); But this doesn't: $arr = array("one","two","three"); $arr = autopad($arr, 30000); Isn't that a mistery or what?!
  22. THANKS Daniel, it works! Nice trick that microtime(true)!!! $start = microtime(true); sleep(3); if (microtime(true) - $start >= 2) { echo 'More than 2 sec had passed.'; } echo (microtime(true) - $start);
×
×
  • 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.