Jump to content

confused and dazed

  • Posts

  • Joined

  • Last visited

Everything posted by confused and dazed

  1. I did some basic internet searching of the error I got clicking on the view source - inspect - .js link the error is "Not allowed to load local resource" the answers were jquery is not allow to access your local files. I actually don't have it in my server I miss-spoke about about. I just have it in my local files. I'm sure you would have mentioned that had I not misled you. thanks for pointing out that I can use view source and click on links use inspect to view errors on that. THANKS!
  2. It does not... But all the other jquery functions on my page are working though... just not the fadeOut
  3. Hello internet. I am trying to use the following code and my webpage is not accepting my fadeOut function I'm using <link> to grab the jquery library from my server. CODE: $("div").click(function() { $(this).fadeOut("slow"); }); However, if I replace <script type="text/javascript" src="jquery.min.js"></script> WITH <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> It works just fine. Why is this? NOTES: 1. I am placing jquery code within my <head> tags. 2. jquery.min.js is the 3.1.0 compressed file I have on my server
  4. What's strange is that Safari is the only browser that is doing that... why would that be? I created the image in Microsoft Excel and saved it as a png in a picture editor I use. I like Microsoft excel's shapes and effects so I tend to create images copy them and paste them into a picture editor to finish it up and save it as a png. I placed the image as a button background using a class callout referencing a remote CSS file - code below. I have never had an issue like this and I have used this technique for the past several years. Source Code: <div class='sb1'> <input type='button' name='submitb' class='b1' value='Begin Scoring' id='submitb' onClick='check();'> </div> CSS remote Code: .sb1 { width:200px; height:45px; position:absolute; margin-left:30px; margin-top:30px; background: url(b3.png); border: 0px solid black;} .b1 { width:200px; height:40px; position:absolute; margin-top:2px; background-color:transparent; font-size:12pt; font-family:Calibri; color:#ffffff border: 0px solid black;}
  5. Hello Internet, I'm having an issue with how Safari is rendering a picture on my smartphone - but not chrome. Any thoughts on why this is happening? Please attached image.
  6. What other options do you recommend? If PHP isn't the tool for the job then what can I start to try and teach myself? BTW - I used the header() call to redirect and it worked. One Page two redirects.
  7. Ok. Having said that - the networks that I am using I have no control over them so it appears I need another way around this. First I thought I would try to streamline my code through the routines and functions I am asking it to do but the fact remains I need to cURL 50+ pages and send data to mysql. I cannot get around this. So what I have done is limit the requests to 20 and string the php files along. my_php_file1.php handles the first 20, my_php_file2.php handles the second 20, my_php_file3.php handles the remaining requests. At the end of each php file I have a simple form with a submit button to go to the next php file. Any thoughts on what might work better than having to submit three php requests (in series) to complete all 50+ requests?
  8. OK so I did this and the Network Tab is showing instantly the php file that the javascript function sends it to. The Network tab in the first window shows: Name - the_name_of_my_php_file Method - post Status - 504 Type - text/... Initiator - the_name_of_my_js_file Size - 68B The time shows "pending" until it cuts off and then showed - 45.99s Also the Timing tab in the second window shows: Stalled - 1.818ms Request sent - 0.299ms Waiting (TTFB) - 45.99s content Download - 0.782ms Also on the Preview & Response tab in the second window shows: "Failed to load response data"
  9. So I did a bunch of test runs and it appears my chrome browser only wants to run 24 of the 52 requests with positive feedback through the echo statements that the code has executed (I used a die statement to limit the number of requests). Chrome will only leave the browser running for 41 seconds. I looked in the setting for the browser and there does not seem to be any settings for this. Any thoughts?
  10. I called my hosting account and they said to check the php5.ini file and change the max_execute_time I changed it to 300 and it is still the same thing. The guy seemed pretty knowledgeable and he said the php5ini file controls that for my hosting account.
  11. Something that is interesting is that the page wont load and show the echo statements I have in there. However, over time as I refresh my database all the 50+ lines end up showing up in my database. It will show 20 then I refresh and it shows 30 and I refresh and it shows 40 etc.... But I do this all after the php page has stopped showing the refresh arrow circulating in the tab. What does all this mean?
  12. I timed it out and the page stops running after about 30 actual seconds
  13. Does it matter where the call is placed? Because it is still appears to be stopping before the limit and not completing the execution of the code. Right now I have placed as shown below: <?php set_time_limit(200); $con = mysql_connect("source","db","pw"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("db", $con); while ($row = mysql_fetch_assoc($result)) { $ch = curl_init(); curl_close($ch); $dom = new DOMDocument(); @$dom->loadHTML($postResult); foreach($dom->getElementsByTagName('script') as $links1) { $links2 = $dom->saveXML($links1); if (preg_match(something)) { mysql_query("UPDATE something SET this='bingo' WHERE name='thisstuff'"); } } } ?>
  14. So I am well on my way to getting my next project up and running. Thanks for the help through this. I do have another question though, my program seems to time out and the code cannot complete all the commands on the rows "$row" from the database. In all I'm grabbing about 50+ different webpages, scrapping the data I care about, and then sending it to my database (one page at a time). Is there anything anyone can suggest for this issue? while ($row = mysql_fetch_assoc($result)) { $username='usr'; $password='pas'; $ch = curl_init(); $agent = $_SERVER["HTTP_USER_AGENT"]; curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_URL, $thislink ); curl_setopt($ch, CURLOPT_POST, 1 ); curl_setopt($ch, CURLOPT_POSTFIELDS, 'user='.$username.'&pass='.$password); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt'); $postResult = curl_exec($ch); curl_close($ch); $dom = new DOMDocument(); @$dom->loadHTML($postResult); foreach($dom->getElementsByTagName('script') as $links1) { $links2 = $dom->saveXML($links1); if (preg_match(something)) { mysql_query("UPDATE something SET this='bingo' WHERE name='thisstuff'"); } } }
  15. I did a json_decode on the string and saved it in $data I did a var_dump and the following code was in the source code: [some] => stdClass Object ( [extra] => 1 [really] => Array ( [0] => stdClass Object ( [stupid] => 1 [long] => Array ( [0] => stdClass Object ( [thing] => Array ( [0] => stdClass Object ( [sent_me] => X [to] => 00101 [i_want_this] => bingo I used the following call and it worked!!!!!!! $this1 = $data->some->really[0]->long[0]->thing[0]->I_want_this; I have a lot of work ahead of me now that I have figured out how to get to the data I want. It may be a little while before you hear from me again. But until then may all your code be syntax error free!!
  16. Here is what json_decode and var_dump (of that decode) shows me. How do I get "bingo"? I tried to use $this1 = $myjson->main_list->something->I_want_this; I did a var_dump and it came back NULL. Im guessing I may need to pull out I_want_this from object(stdClass)#9 but I dont quite know how to do that... object(stdClass)#5 (2) { ["main_list"]=> object(stdClass)#6 (6) { ["something"]=> int(1) ["areas"]=> array(5) { [0]=> object(stdClass)#7 (6) { ["donuts"]=> int(1) ["pop"]=> string(5) "words" ["here"]=> string(9) "somewhere" ["nice"]=> array(4) { [0]=> object(stdClass)#8 (5) { ["hot"]=> array(8) { [0]=> object(stdClass)#9 (25) { ["cold"]=> string(1) "X" ["here_id"]=> string(5) "00110" ["I_want_this"]=> string(5) "bingo"........ and it just goes on and on......
  17. I did the var_dump and it put this string(48723) " in front of what I already wrote above which was this {"main list":{level1":1,"stuff1":[{"a1":1,"a2":"2","a3":"3","somelevel":[{"getstricky":[{"keepsgoing":"X", and so forth.......} any suggestions?
  18. OK so I was able to sort out the regular expression call and was able to get the bootstrap table into a string. I was able to echo the string out so I know I captured it. The string looks like this {the table} and is completely enclosed in curly brackets. Now the next problem, I am not able to get "bingo" from "I_want_this". The bootstrap table is very complex it follows this sort of structure {"main list":{level1":1,"stuff1":[{"a1":1,"a2":"2","a3":"3","somelevel":[{"getstricky":[{"keepsgoing":"X", and so forth.......} the table is quite complex. Also there appears to be more than one "I_want_this" within the table with different values. bingo is one, touchdown is another and so on. How would I capture all of the individual "I_want_this" values from the table?
  19. no matter what I try it appears step 2 is not considering $links1 as a string so therefore I don't even get a 0 when this code executes. 1. foreach($dom->getElementsByTagName('script') as $links1) { 2. echo preg_match('/no_matter_what_I_try/', $links1); 3. $data = json_decode($links1, true); 4. echo $data['I_want_this'];
  20. foreach($dom->getElementsByTagName('script') as $links1) { preg_match('bootstrapthisstuff = { ... }', $links1); $data = json_decode($links1, true); echo $data['I_want_this']; } This brings nothing....
  21. The bootstrap is all on one line - one VERY LONG LINE. I'm not looking for any of the var values - I'm looking to extract "bingo" from the bootstrap bootstrapthisstuff = {"status":"X","some_id":"112","getting_close":"ER","I_want_this":"bingo"} Also I put in a counter{ $i=1......$i++} echo $i; and it lists the correct amount of Script tags in the source data which is 46. So I know its getting into the script tags
  22. I can do that - but I would like to try and get it on my own... are there any partiicular rules you can think of for me to try? Here is a very simplistic version of what is between the script tags <script> // comments // comments (function(){ A WHOLE LOT OF STUFF}).call(this); // comments // comments (function(){ ANOTHER HUGE FUNCTION WITH A WHOLE LOT OF STUFF}).call(this); // comments // comments Backbone.STUFF = (function() STUFF); // comments // comments Wreqr.Commands = (function() STUFF); // comments // comments var x1 = 'something1', x2 = 'something2', x3 = 'something3', x4 = 'something4', x5 = 'something5', x6 = 'something6'; bootstrapthisstuff = {"status":"X","some_id":"112","getting_close":"ER","I_want_this":"bingo"} </script> This is basically what is between the scripts
  23. As I look back through the 3000 plus lines of source code in between the script tags - a few things stick out 1. There are MANY "function()"s before this particular bootstrap begins 2. There are several "_.extend(" methods before this particular bootstrap begins - but I'm guessing this does not mean much 3. The bootstrap is not inside any function - it stands alone 4. the bootstrap is the last set of data between the script tags
  24. That's part of the problem - I am not able to extract the data. what call should I use to extract the content from the script element and save it as a string?
  • Create New...