Jump to content

ankhmor

Members
  • Posts

    46
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ankhmor's Achievements

Member

Member (2/5)

0

Reputation

  1. Yes i have restarted it. It doesnt work in a way that it loads output only once the whole script is done running.
  2. Hi. I have a problem with output buffering. I'm using wamp. I've tried setting the php.ini file to output_buffering = 0 and off I've tried using flush() and ob_flush(), separetly and together. I've tried turning on implicit_flush. Nothing works. Any ideas? I'm using the flowing code to test right now: echo 'starting...<br/>'; for($i = 0; $i < 5; $i++) { print "$i<br/>"; flush(); sleep(2); } print 'DONE!<br/>';
  3. nah its definitely in the foreach loop. and if it wasn't it would only echo one line instead of hundreds.
  4. I have a script that has a foreach loop. The script ususally runs for VERY VERY long time ( i have set_time_limit(0) Now what I need it to do is to echo some string at the end of each loop. However it doesn't. The script displays everything after its finished. That's not acceptable for me. I'm running xampp for windows.
  5. Hi. The script within beforeSend : doesn't work. Still doesn't work even if I remove sucess: . Any ideas? $(document).ready( function () { $("#form_code").submit(function(){ $("#form_code").css("display", "none"); }) $.ajax({ type: "POST", url: "main.php", data: "password=048478", beforeSend: function { alert( "Data Saved:"); }, success: function(msg){ alert( "Data Saved: " + msg ); } }); });
  6. wrapping everything in document.ready part worked. but is there an alternative?
  7. This is what I load in the head of my index.php <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> <script src="js_functions.js" type="text/javascript"></script> this is part of index.php <div id="output"> </div> In the js_function.js the following works $(document).ready( function () { alert('The document is ready.'); } ); or $(document).click( function () { alert('The document is ready.'); } ); However the following does not. $("#output").click( function () { alert('The document is ready.'); } );
  8. I was wondering if there was any way that I could pause a php script and then restart it with USER INPUT? Kind of like when you are copying a file to a folder with the same file name and Windows asks you if you want to copy it there. I was also thinking that if above isn't possible, would it be possible to start a curl session in one script (say index.php) and then continue it in another (say curl.php)?
  9. figured it out. for some reason the cookie file was being created in the root directory of xampp and not in the htdocs/path
  10. I tried using $cookie_file_path = "cookie.txt"; $fp = fopen($cookie_file_path,'wb'); fclose($fp); $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7"; $reffer = "http://www.facebook.com/login.php"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"https://login.facebook.com/login.php"); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_fie_path); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); curl_setopt($ch, CURLOPT_REFERER, "http://www.facebook.com/login.php"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_POSTFIELDS, "charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&version=1.0&return_session=0&charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&email=user%40gmail.com&pass=0000000"); $html = curl_exec($ch); echo $html; but the cookie file is empty and facebook tells me that i don't have cookies enabled. wtf?
  11. I get this Array ( [url] => the page url [content_type] => text/html [http_code] => 200 [header_size] => 476 [request_size] => 153 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.063 [namelookup_time] => 0 [connect_time] => 0.016 [pretransfer_time] => 0.016 [size_upload] => 0 [size_download] => 8447 [speed_download] => 134079 [speed_upload] => 0 [download_content_length] => 8447 [upload_content_length] => -1 [starttransfer_time] => 0.063 [redirect_time] => 0 )
  12. As AbraCadaver stated, you should fix your consistency errors (variables names should stay the same for ex): curl_setopt ($curl_handle, CURLOPT_COOKIEJAR, $tmphandle); curl_setopt ($curl_handle, CURLOPT_COOKIEFILE, $tmphandle); Should be: curl_setopt ($curl_handle, CURLOPT_COOKIEJAR, $tmpfname); curl_setopt ($curl_handle, CURLOPT_COOKIEFILE, $tmpfname); And use integer boolean values (0,1) instead of string boolean (true,false) when defining cURL Options. For example: curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1); hope this helps That didn't do the trick actually. Also the part where echo "<!--// Look in page-source (html) to view this properly: \n", print_r($info), "\n //-->\n", $output; in page source $info shows up as 1 and it is before the rest of the page however if i set CURLOPT_RETURNTRANSFER to 0 then i end up with the following on the bottom of page source <!--// Look in page-source (html) to view this properly: 1 //--> 1
  13. I have the following script and I've been trying to make it work for hours $tmpfname = "temp\cookie.txt"; $curl_handle=curl_init(); $user_agent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/5.0)"; curl_setopt($curl_handle,CURLOPT_URL,'url goes here'); curl_setopt($curl_handle, CURLOPT_USERAGENT, $user_agent); curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,FALSE); curl_setopt ($curl_handle, CURLOPT_HEADER, TRUE); curl_setopt ($curl_handle, CURLOPT_COOKIEJAR, $tmphandle); curl_setopt ($curl_handle, CURLOPT_COOKIEFILE, $tmphandle); curl_exec($curl_handle); curl_close($curl_handle); } There are 2 problems. 1. the most important is that the cookies don't save. However in the header that i get there's plenty of Set-Cookie: 2. I've set CURLOPT_RETURNTRANSFER to false, however I still see the webpage when I run cURL. I even deleted the portion where I echoed the buffer (I used to have CURLOPT_RETURNTRANSFER set to true). I used to have this portion of the code if (empty($buffer)) { print "Sorry, unable to retrive site.<p>"; } else { print $buffer; } but all the buffer printed out was "1" (without the quotes) Any ideas?
  14. hi. I have a google map in which I load a kml overlay file. Then I need a button on the page itself that could remove the overlay. In google api manual it says to enable the layer you need to do this var georssLayer = new google.maps.KmlLayer('http://api.flickr.com/services/feeds/geo/?g=322338@N20〈=en-us&format=feed-georss'); georssLayer.setMap(map); To DISABLE you need to do this "You can hide a KmlLayer by setting this value to null within the setMap() method." However if I do this on my page <input type="button" value="Remove overlay" onclick="georssLayer.setMap(null)"/> it doesn't work. I'm not really good with javascript. Any help?
  15. so I have an xml string the following expression $xpath = $response->xpath('/atom:feed/atom:entry/atom:content'); returns the following array SimpleXMLElement Object ( [@attributes] => Array ( [type] => application/vnd.google-earth.kml+xml ) [Placemark] => SimpleXMLElement Object ( [name] => M1 [description] => SimpleXMLElement Object ( ) [style] => SimpleXMLElement Object ( [iconStyle] => SimpleXMLElement Object ( [icon] => SimpleXMLElement Object ( [href] => http://maps.gstatic.com/intl/en_ALL/mapfiles/ms/micons/blue-dot.png ) ) ) [Point] => SimpleXMLElement Object ( [coordinates] => -79.395018,43.645423,0.0 ) ) ) However what I'm trying to get are the coordinates, but neither $xpath = $response->xpath('/atom:feed/atom:entry/atom:content/Placemark'); OR $xpath = $response->xpath('/atom:feed/atom:entry/atom:content/Placemark/child::*'); work I even tried just loading atom:content into an array and going from there no luck. Any ideas. Oh. BTW this might help http://code.google.com/apis/maps/documentation/mapsdata/developers_guide_protocol.html#RetrievingFeatures
×
×
  • 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.